diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-21 12:59:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 12:59:42 -0400 |
commit | a1b942ff401a9315dae05d9a3210780823d12839 (patch) | |
tree | 8da82d1850e9e5d833a9e5faa4457afab634db78 /cmd/podman/root.go | |
parent | 9060af971911b6b4c21b2b24d011835954058d30 (diff) | |
parent | 980b1e87d40eedc175cdc76da668572b91784448 (diff) | |
download | podman-a1b942ff401a9315dae05d9a3210780823d12839.tar.gz podman-a1b942ff401a9315dae05d9a3210780823d12839.tar.bz2 podman-a1b942ff401a9315dae05d9a3210780823d12839.zip |
Merge pull request #8034 from rhatdan/options
Switch help messages from using [flags] to [options]
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r-- | cmd/podman/root.go | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 6293fa17d..b59b8341a 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -38,7 +38,7 @@ Description: // command should not use this. const usageTemplate = `Usage:{{if (and .Runnable (not .HasAvailableSubCommands))}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} - {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} + {{.UseLine}} [command]{{end}}{{if gt (len .Aliases) 0}} Aliases: {{.NameAndAliases}}{{end}}{{if .HasExample}} @@ -49,24 +49,24 @@ Examples: Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} -Flags: +Options: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} {{end}} ` var ( rootCmd = &cobra.Command{ - Use: path.Base(os.Args[0]), - Long: "Manage pods, containers and images", - SilenceUsage: true, - SilenceErrors: true, - TraverseChildren: true, - PersistentPreRunE: persistentPreRunE, - RunE: validate.SubCommandExists, - PersistentPostRunE: persistentPostRunE, - Version: version.Version.String(), + Use: path.Base(os.Args[0]) + " [options]", + Long: "Manage pods, containers and images", + SilenceUsage: true, + SilenceErrors: true, + TraverseChildren: true, + PersistentPreRunE: persistentPreRunE, + RunE: validate.SubCommandExists, + PersistentPostRunE: persistentPostRunE, + Version: version.Version.String(), + DisableFlagsInUseLine: true, } - logLevels = []string{"debug", "info", "warn", "error", "fatal", "panic"} logLevel = "error" useSyslog bool @@ -81,6 +81,7 @@ func init() { ) rootFlags(rootCmd, registry.PodmanConfig()) + rootCmd.SetUsageTemplate(usageTemplate) } func Execute() { |