Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

CLI help cleanup #945

Merged
merged 3 commits into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/fluxctl/automate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (opts *controllerAutomateOpts) Command() *cobra.Command {
Use: "automate",
Short: "Turn on automatic deployment for a controller.",
Example: makeExample(
"fluxctl automate --controller=deployment/helloworld",
"fluxctl automate --controller=default:deployment/helloworld",
),
RunE: opts.RunE,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluxctl/deautomate_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (opts *controllerDeautomateOpts) Command() *cobra.Command {
Use: "deautomate",
Short: "Turn off automatic deployment for a controller.",
Example: makeExample(
"fluxctl deautomate --controller=deployment/helloworld",
"fluxctl deautomate --controller=default:deployment/helloworld",
),
RunE: opts.RunE,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluxctl/lock_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (opts *controllerLockOpts) Command() *cobra.Command {
Use: "lock",
Short: "Lock a controller, so it cannot be deployed.",
Example: makeExample(
"fluxctl lock --controller=deployment/helloworld",
"fluxctl lock --controller=default:deployment/helloworld",
),
RunE: opts.RunE,
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/fluxctl/policy_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ If both --tag-all and --tag are specified, --tag-all will apply to all
containers which aren't explicitly named.
`,
Example: makeExample(
"fluxctl policy --controller=deployment/foo --automate",
"fluxctl policy --controller=deployment/foo --lock",
"fluxctl policy --controller=deployment/foo --tag='bar=1.*' --tag='baz=2.*'",
"fluxctl policy --controller=deployment/foo --tag-all='master-*' --tag='bar=1.*'",
"fluxctl policy --controller=default:deployment/foo --automate",
"fluxctl policy --controller=default:deployment/foo --lock",
"fluxctl policy --controller=default:deployment/foo --tag='bar=1.*' --tag='baz=2.*'",
"fluxctl policy --controller=default:deployment/foo --tag-all='master-*' --tag='bar=1.*'",
),
RunE: opts.RunE,
}
Expand Down
16 changes: 8 additions & 8 deletions cmd/fluxctl/release_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ func (opts *controllerReleaseOpts) Command() *cobra.Command {

AddOutputFlags(cmd, &opts.outputOpts)
AddCauseFlags(cmd, &opts.cause)
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "controller namespace")
cmd.Flags().StringSliceVarP(&opts.controllers, "controller", "c", []string{}, "list of controllers to release <kind>/<name>")
cmd.Flags().BoolVar(&opts.allControllers, "all", false, "release all controllers")
cmd.Flags().StringVarP(&opts.image, "update-image", "i", "", "update a specific image")
cmd.Flags().BoolVar(&opts.allImages, "update-all-images", false, "update all images to latest versions")
cmd.Flags().StringSliceVar(&opts.exclude, "exclude", []string{}, "exclude a controller")
cmd.Flags().BoolVar(&opts.dryRun, "dry-run", false, "do not release anything; just report back what would have been done")
cmd.Flags().StringVarP(&opts.namespace, "namespace", "n", "default", "Controller namespace")
cmd.Flags().StringSliceVarP(&opts.controllers, "controller", "c", []string{}, "List of controllers to release <namespace>:<kind>/<name>")
cmd.Flags().BoolVar(&opts.allControllers, "all", false, "Release all controllers")
cmd.Flags().StringVarP(&opts.image, "update-image", "i", "", "Update a specific image")
cmd.Flags().BoolVar(&opts.allImages, "update-all-images", false, "Update all images to latest versions")
cmd.Flags().StringSliceVar(&opts.exclude, "exclude", []string{}, "List of controllers to exclude")
cmd.Flags().BoolVar(&opts.dryRun, "dry-run", false, "Do not release anything; just report back what would have been done")

// Deprecated
cmd.Flags().StringSliceVarP(&opts.services, "service", "s", []string{}, "service to release")
cmd.Flags().StringSliceVarP(&opts.services, "service", "s", []string{}, "Service to release")
cmd.Flags().MarkHidden("service")

return cmd
Expand Down
8 changes: 4 additions & 4 deletions cmd/fluxctl/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ var rootLongHelp = strings.TrimSpace(`
fluxctl helps you deploy your code.

Workflow:
fluxctl list-controllers # Which controllers are running?
fluxctl list-images --controller=deployment/foo # Which images are running/available?
fluxctl release --controller=deployment/foo --update-image=bar:v2 # Release new version.
fluxctl list-controllers # Which controllers are running?
fluxctl list-images --controller=default:deployment/foo # Which images are running/available?
fluxctl release --controller=default:deployment/foo --update-image=bar:v2 # Release new version.
`)

const (
Expand All @@ -51,7 +51,7 @@ func (opts *rootOpts) Command() *cobra.Command {
PersistentPreRunE: opts.PersistentPreRunE,
}
cmd.PersistentFlags().StringVarP(&opts.URL, "url", "u", "https://cloud.weave.works/api/flux",
fmt.Sprintf("base URL of the flux service; you can also set the environment variable %s", envVariableURL))
fmt.Sprintf("Base URL of the flux service; you can also set the environment variable %s", envVariableURL))
cmd.PersistentFlags().StringVarP(&opts.Token, "token", "t", "",
fmt.Sprintf("Weave Cloud service token; you can also set the environment variable %s or %s", envVariableCloudToken, envVariableToken))

Expand Down
2 changes: 1 addition & 1 deletion cmd/fluxctl/save_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (opts *saveOpts) Command() *cobra.Command {
),
RunE: opts.RunE,
}
cmd.Flags().StringVarP(&opts.path, "out", "o", "-", "output path for exported config; the default. '-' indicates stdout; if a directory is given, each item will be saved in a file under the directory")
cmd.Flags().StringVarP(&opts.path, "out", "o", "-", "Output path for exported config; the default. '-' indicates stdout; if a directory is given, each item will be saved in a file under the directory")
return cmd
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/fluxctl/unlock_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (opts *controllerUnlockOpts) Command() *cobra.Command {
Use: "unlock",
Short: "Unlock a controller, so it can be deployed.",
Example: makeExample(
"fluxctl unlock --controller=deployment/helloworld",
"fluxctl unlock --controller=default:deployment/helloworld",
),
RunE: opts.RunE,
}
Expand Down
2 changes: 1 addition & 1 deletion update/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type ReleaseType string

const (
ReleaseKindPlan ReleaseKind = "plan"
ReleaseKindExecute = "execute"
ReleaseKindExecute ReleaseKind = "execute"
)

func ParseReleaseKind(s string) (ReleaseKind, error) {
Expand Down