aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-02-28 08:28:23 -0700
committerEd Santiago <santiago@redhat.com>2019-02-28 13:16:24 -0700
commit742028e2556c26c3ef9e1645c2431ca81b00e190 (patch)
treee0d3d84e3bf1cb9fe3707f58efbe6a9092a965bf /cmd
parent4a109a71996e99c9a95b639bbbee1c5e30450c97 (diff)
downloadpodman-742028e2556c26c3ef9e1645c2431ca81b00e190.tar.gz
podman-742028e2556c26c3ef9e1645c2431ca81b00e190.tar.bz2
podman-742028e2556c26c3ef9e1645c2431ca81b00e190.zip
podman-commands script: refactor
Make more general-purpose: instead of hardcoding a list of known subcommands, and duplicating sed pipelines for each, rely on 'podman help' itself to tell us which podman commands have subcommands; and examine each in turn. Should there ever be new subcommands, this will identify and test them. A special case is needed for 'podman image trust', whose documentation format doesn't match the others. The change to `common.go` fixes an inconsistency: the Usage message for commands with subcommands had an unnecessary blank line, making it harder to parse automatically. This simply produces consistent Usage messages for all podman commands. This script will not pass until #2480 is merged. After that, the goal is to add this as a CI hook. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index f9dfa3759..e980e10f9 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -519,7 +519,6 @@ func scrubServer(server string) string {
func UsageTemplate() string {
return `Usage:{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
-
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
Aliases: