// SetFlags implements Command.SetFlags, then calls the wrapped command's SetFlags. func (w *sysCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if w.setFlags { f.StringVar(&w.controllerName, "c", "", "juju controller to operate in") f.StringVar(&w.controllerName, "controller", "", "") } w.ControllerCommand.SetFlags(f) }
func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) f.Var(constraints.ConstraintsValue{&c.Constraints}, "constraints", "set environment constraints") f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version of tools before bootstrapping") f.Var(seriesVar{&c.Series}, "series", "upload tools for supplied comma-separated series list") f.StringVar(&c.Source, "source", "", "local path to use as tools source") }
func (c *toolsMetadataCommand) SetFlags(f *gnuflag.FlagSet) { f.StringVar(&c.metadataDir, "d", "", "local directory in which to store metadata") // If no stream is specified, we'll generate metadata for the legacy tools location. f.StringVar(&c.stream, "stream", "", "simplestreams stream for which to generate the metadata") f.BoolVar(&c.clean, "clean", false, "remove any existing metadata for the specified stream before generating new metadata") f.BoolVar(&c.public, "public", false, "tools are for a public cloud, so generate mirrors information") }
func (c *DestroyEnvironmentCommand) SetFlags(f *gnuflag.FlagSet) { f.BoolVar(&c.assumeYes, "y", false, "Do not ask for confirmation") f.BoolVar(&c.assumeYes, "yes", false, "") f.BoolVar(&c.force, "force", false, "Forcefully destroy the environment, directly through the environment provider") f.StringVar(&c.envName, "e", "", "juju environment to operate in") f.StringVar(&c.envName, "environment", "", "juju environment to operate in") }
func (c *UpgradeCharmCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) f.BoolVar(&c.Force, "force", false, "upgrade all units immediately, even if in error state") f.StringVar(&c.RepoPath, "repository", os.Getenv("JUJU_REPOSITORY"), "local charm repository path") f.StringVar(&c.SwitchURL, "switch", "", "crossgrade to a different charm") f.IntVar(&c.Revision, "revision", -1, "explicit revision of current charm") }
func (w *environCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if !w.skipFlags { f.StringVar(&w.envName, "e", "", "juju environment to operate in") f.StringVar(&w.envName, "environment", "", "") } w.EnvironCommand.SetFlags(f) }
// SetFlags implements Command.SetFlags, then calls the wrapped command's SetFlags. func (w *sysCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if w.setFlags { f.StringVar(&w.systemName, "s", "", "juju system to operate in") f.StringVar(&w.systemName, "system", "", "") } w.SystemCommand.SetFlags(f) }
func (w *modelCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if !w.skipFlags { f.StringVar(&w.envName, "m", "", "juju model to operate in") f.StringVar(&w.envName, "model", "", "") } w.ModelCommand.SetFlags(f) }
func (w *modelCommandWrapper) SetFlags(f *gnuflag.FlagSet) { if !w.skipFlags { f.StringVar(&w.modelName, "m", "", "Model to operate in. Accepts [<controller name>:]<model name>") f.StringVar(&w.modelName, "model", "", "") } w.ModelCommand.SetFlags(f) }
func (c *UpgradeJujuCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) f.StringVar(&c.vers, "version", "", "upgrade to specific version") f.BoolVar(&c.Development, "dev", false, "allow development versions to be chosen") f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version of tools") f.Var(seriesVar{&c.Series}, "series", "upload tools for supplied comma-separated series list") }
// AddFlags injects common agent flags into f. func (c *agentConf) AddFlags(f *gnuflag.FlagSet) { // TODO(dimitern) 2014-02-19 bug 1282025 // We need to pass a config location here instead and // use it to locate the conf and the infer the data-dir // from there instead of passing it like that. f.StringVar(&c.dataDir, "data-dir", util.DataDir, "directory for juju data") }
func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet) { c.AgentConf.AddFlags(f) yamlBase64Var(f, &c.EnvConfig, "env-config", "", "initial environment configuration (yaml, base64 encoded)") f.Var(constraints.ConstraintsValue{Target: &c.Constraints}, "constraints", "initial environment constraints (space-separated strings)") f.Var(&c.Hardware, "hardware", "hardware characteristics (space-separated strings)") f.StringVar(&c.InstanceId, "instance-id", "", "unique instance-id for bootstrap machine") }
func (c *RemoteCommand) Init(f *gnuflag.FlagSet, args []string) error { f.StringVar(&c.msg, "error", "", "if set, fail") if err := f.Parse(true, args); err != nil { return err } return cmd.CheckEmpty(f.Args()) }
func (c *BootstrapCommand) SetFlags(f *gnuflag.FlagSet) { f.Var(constraints.ConstraintsValue{Target: &c.Constraints}, "constraints", "set environment constraints") f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version of tools before bootstrapping") f.Var(newSeriesValue(nil, &c.Series), "upload-series", "upload tools for supplied comma-separated series list") f.Var(newSeriesValue(nil, &c.seriesOld), "series", "upload tools for supplied comma-separated series list (DEPRECATED, see --upload-series)") f.StringVar(&c.MetadataSource, "metadata-source", "", "local path to use as tools and/or metadata source") f.StringVar(&c.Placement, "to", "", "a placement directive indicating an instance to bootstrap") }
// AddFlags adds appropriate flags to f. func (l *Log) AddFlags(f *gnuflag.FlagSet) { f.StringVar(&l.Path, "log-file", "", "path to write log to") // TODO(thumper): rename verbose to --show-log f.BoolVar(&l.Verbose, "v", false, "if set, log additional messages") f.BoolVar(&l.Verbose, "verbose", false, "if set, log additional messages") f.BoolVar(&l.Debug, "debug", false, "if set, log debugging messages") f.StringVar(&l.Config, "log-config", "", "specify log levels for modules") }
func (c *upgradeJujuCommand) SetFlags(f *gnuflag.FlagSet) { f.StringVar(&c.vers, "version", "", "upgrade to specific version") f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version of tools") f.BoolVar(&c.DryRun, "dry-run", false, "don't change anything, just report what would change") f.BoolVar(&c.ResetPrevious, "reset-previous-upgrade", false, "clear the previous (incomplete) upgrade status (use with care)") f.BoolVar(&c.AssumeYes, "y", false, "answer 'yes' to confirmation prompts") f.BoolVar(&c.AssumeYes, "yes", false, "") }
// SetFlags handles known option flags. func (c *restoreCommand) SetFlags(f *gnuflag.FlagSet) { f.Var(constraints.ConstraintsValue{Target: &c.constraints}, "constraints", "set environment constraints") f.BoolVar(&c.bootstrap, "b", false, "bootstrap a new state machine") f.StringVar(&c.filename, "file", "", "provide a file to be used as the backup.") f.StringVar(&c.backupId, "id", "", "provide the name of the backup to be restored.") }
func (c *RpcCommand) Init(f *gnuflag.FlagSet, args []string) error { f.StringVar(&c.Value, "value", "", "doc") f.BoolVar(&c.Slow, "slow", false, "doc") if err := f.Parse(true, args); err != nil { return err } return cmd.CheckEmpty(f.Args()) }
// SetFlags implements cmd.Command. func (c *ListCharmResourcesCommand) SetFlags(f *gnuflag.FlagSet) { defaultFormat := "tabular" c.out.AddFlags(f, defaultFormat, map[string]cmd.Formatter{ "tabular": FormatCharmTabular, "yaml": cmd.FormatYaml, "json": cmd.FormatJson, }) f.StringVar(&c.channel, "channel", "stable", "the charmstore channel of the charm") }
func (c *RelationSetCommand) SetFlags(f *gnuflag.FlagSet) { f.Var(c.relationIdProxy, "r", "specify a relation by id") f.Var(c.relationIdProxy, "relation", "") c.settingsFile.SetStdin() f.Var(&c.settingsFile, "file", "file containing key-value pairs") f.StringVar(&c.formatFlag, "format", "", "deprecated format flag") }
func (c *TestCommand) Init(f *gnuflag.FlagSet, args []string) error { if !c.Minimal { f.StringVar(&c.Option, "option", "", "option-doc") } if err := f.Parse(true, args); err != nil { return err } return cmd.CheckEmpty(f.Args()) }
func (c *ValidateImageMetadataCommand) SetFlags(f *gnuflag.FlagSet) { c.out.AddFlags(f, "smart", cmd.DefaultFormatters) f.StringVar(&c.providerType, "p", "", "the provider type eg ec2, openstack") f.StringVar(&c.metadataDir, "d", "", "directory where metadata files are found") f.StringVar(&c.series, "s", "", "the series for which to validate (overrides env config series)") f.StringVar(&c.region, "r", "", "the region for which to validate (overrides env config region)") f.StringVar(&c.endpoint, "u", "", "the cloud endpoint URL for which to validate (overrides env config endpoint)") f.StringVar(&c.stream, "m", "", "the images stream (defaults to released)") }
// SetFlags is defined on the cmd.Command interface. func (c *ListCommand) SetFlags(f *gnuflag.FlagSet) { c.SubnetCommandBase.SetFlags(f) c.out.AddFlags(f, "yaml", map[string]cmd.Formatter{ "yaml": cmd.FormatYaml, "json": cmd.FormatJson, }) f.StringVar(&c.SpaceName, "space", "", "filter results by space name") f.StringVar(&c.ZoneName, "zone", "", "filter results by zone name") }
func (c *DeployCommand) SetFlags(f *gnuflag.FlagSet) { c.UnitCommandBase.SetFlags(f) f.IntVar(&c.NumUnits, "n", 1, "number of service units to deploy for principal charms") f.BoolVar(&c.BumpRevision, "u", false, "increment local charm directory revision (DEPRECATED)") f.BoolVar(&c.BumpRevision, "upgrade", false, "") f.Var(&c.Config, "config", "path to yaml-formatted service config") f.Var(constraints.ConstraintsValue{Target: &c.Constraints}, "constraints", "set service constraints") f.StringVar(&c.Networks, "networks", "", "bind the service to specific networks") f.StringVar(&c.RepoPath, "repository", os.Getenv(osenv.JujuRepositoryEnvKey), "local charm repository") }
// SetFlags handles known option flags. func (c *restoreCommand) SetFlags(f *gnuflag.FlagSet) { c.CommandBase.SetFlags(f) f.Var(constraints.ConstraintsValue{Target: &c.constraints}, "constraints", "set model constraints") f.BoolVar(&c.bootstrap, "b", false, "bootstrap a new state machine") f.StringVar(&c.filename, "file", "", "provide a file to be used as the backup.") f.StringVar(&c.backupId, "id", "", "provide the name of the backup to be restored.") f.BoolVar(&c.uploadTools, "upload-tools", false, "upload tools if bootstraping a new machine.") }
func (c *DeployCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) c.UnitCommandBase.SetFlags(f) f.IntVar(&c.NumUnits, "n", 1, "number of service units to deploy for principal charms") f.BoolVar(&c.BumpRevision, "u", false, "increment local charm directory revision") f.BoolVar(&c.BumpRevision, "upgrade", false, "") f.Var(&c.Config, "config", "path to yaml-formatted service config") f.Var(constraints.ConstraintsValue{&c.Constraints}, "constraints", "set service constraints") f.StringVar(&c.RepoPath, "repository", os.Getenv("JUJU_REPOSITORY"), "local charm repository") }
func (c *SyncToolsCommand) SetFlags(f *gnuflag.FlagSet) { c.EnvCommandBase.SetFlags(f) f.BoolVar(&c.allVersions, "all", false, "copy all versions, not just the latest") f.BoolVar(&c.dryRun, "dry-run", false, "don't copy, just print what would be copied") f.BoolVar(&c.dev, "dev", false, "consider development versions as well as released ones") f.BoolVar(&c.publicBucket, "public", false, "write to the public-bucket of the account, instead of the bucket private to the environment.") f.StringVar(&c.source, "source", "", "chose a location on the file system as source") // BUG(lp:1163164) jam 2013-04-2 we would like to add a "source" // location, rather than only copying from us-east-1 }
func (c *syncToolsCommand) SetFlags(f *gnuflag.FlagSet) { f.BoolVar(&c.allVersions, "all", false, "copy all versions, not just the latest") f.StringVar(&c.versionStr, "version", "", "copy a specific major[.minor] version") f.BoolVar(&c.dryRun, "dry-run", false, "don't copy, just print what would be copied") f.BoolVar(&c.dev, "dev", false, "consider development versions as well as released ones\n DEPRECATED: use --stream instead") f.BoolVar(&c.public, "public", false, "tools are for a public cloud, so generate mirrors information") f.StringVar(&c.source, "source", "", "local source directory") f.StringVar(&c.stream, "stream", "", "simplestreams stream for which to sync metadata") f.StringVar(&c.localDir, "local-dir", "", "local destination directory") f.StringVar(&c.destination, "destination", "", "local destination directory") }
func (c *EnsureAvailabilityCommand) SetFlags(f *gnuflag.FlagSet) { f.IntVar(&c.NumStateServers, "n", 0, "number of state servers to make available") f.StringVar(&c.Series, "series", "", "the charm series") f.Var(constraints.ConstraintsValue{&c.Constraints}, "constraints", "additional machine constraints") c.out.AddFlags(f, "simple", map[string]cmd.Formatter{ "yaml": cmd.FormatYaml, "json": cmd.FormatJson, "simple": formatSimple, }) }
// SetFlags implements Command.SetFlags. func (c *environmentsCommand) SetFlags(f *gnuflag.FlagSet) { f.StringVar(&c.user, "user", "", "the user to list models for (administrative users only)") f.BoolVar(&c.all, "all", false, "show all models (administrative users only)") f.BoolVar(&c.listUUID, "uuid", false, "display UUID for models") f.BoolVar(&c.exactTime, "exact-time", false, "use full timestamp precision") c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{ "yaml": cmd.FormatYaml, "json": cmd.FormatJson, "tabular": c.formatTabular, }) }