Skip to content

Commit 7d12ec8

Browse files
authored
Merge pull request #4733 from niveshdandyan/fix/usage-display
fix: correct usage display to show [command] instead of [flags]
2 parents 1b6c21d + 9599f34 commit 7d12ec8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/nerdctl/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ var (
6464
// usage was derived from https://github.com/spf13/cobra/blob/v1.2.1/command.go#L491-L514
6565
func usage(c *cobra.Command) error {
6666
s := "Usage: "
67-
if c.Runnable() {
67+
if c.HasSubCommands() {
68+
s += c.CommandPath() + " [command]\n"
69+
} else if c.Runnable() {
6870
s += c.UseLine() + "\n"
6971
} else {
7072
s += c.CommandPath() + " [command]\n"

0 commit comments

Comments
 (0)