Skip to content

Commit fa58295

Browse files
authored
use square brackets (#6)
1 parent 855130d commit fa58295

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

argument.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (a *Argument) isOptional() bool {
4242

4343
func (a *Argument) inBrackets() string {
4444
if a.isOptional() {
45-
return fmt.Sprintf("<%s?>", a.name)
45+
return fmt.Sprintf("[<%s>]", a.name)
4646
}
4747

4848
return fmt.Sprintf("<%s>", a.name)

help_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ func TestCommand_renderHelp(t *testing.T) {
4747
test v1.2.3-rc10: test command
4848
4949
Usage:
50-
test [flags] <some-arg> <another-arg?>
50+
test [flags] <some-arg> [<another-arg>]
5151
5252
Arguments:
53-
<some-arg> some arg (type: time.Time)
54-
<another-arg?> another arg (type: int, default: "123")
53+
<some-arg> some arg (type: time.Time)
54+
[<another-arg>] another arg (type: int, default: "123")
5555
5656
Flags:
5757
--help Print help. (type: bool, default: "false")

0 commit comments

Comments
 (0)