Get rid of troublesome [<flags>].

This commit is contained in:
Alec Thomas
2018-06-08 15:02:14 +10:00
parent dd03e4c48a
commit d30421d2b1
2 changed files with 5 additions and 8 deletions
+5 -5
View File
@@ -50,7 +50,7 @@ func TestHelp(t *testing.T) {
})
require.True(t, exited)
t.Log(w.String())
require.Equal(t, `usage: test-app --required [<flags>]
require.Equal(t, `usage: test-app --required
A test app.
@@ -62,13 +62,13 @@ Flags:
--required A required flag.
Commands:
one --required [<flags>]
one --required
A subcommand.
two <three> --required --required-two --required-three [<flags>]
two <three> --required --required-two --required-three
Sub-sub-arg.
two four --required --required-two [<flags>]
two four --required --required-two
Sub-sub-command.
`, w.String())
})
@@ -82,7 +82,7 @@ Commands:
})
require.True(t, exited)
t.Log(w.String())
require.Equal(t, `usage: test-app two <three> --required --required-two --required-three [<flags>]
require.Equal(t, `usage: test-app two <three> --required --required-two --required-three
Sub-sub-arg.
-3
View File
@@ -105,9 +105,6 @@ func (n *Node) FlagSummary() string {
}
}
}
if count != len(required) {
required = append(required, "[<flags>]")
}
return strings.Join(required, " ")
}