Skip to content

Commit eddca5d

Browse files
Use default: in arg descriptions too, standardising the format (#208)
1 parent 1700898 commit eddca5d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ func writeArgumentsSection(cmd *Command, s *strings.Builder) error {
579579
for _, arg := range cmd.args {
580580
line := fmt.Sprintf(" %s\t%s\t%s\t[required]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage())
581581
if arg.Default() != "" {
582-
line = fmt.Sprintf(" %s\t%s\t%s\t[default %s]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage(), arg.Default())
582+
line = fmt.Sprintf(" %s\t%s\t%s\t[default: %s]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage(), arg.Default())
583583
}
584584

585585
fmt.Fprintln(tw, line)

testdata/snapshots/TestHelp/with_named_arguments.snap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Usage: test [OPTIONS] SRC [DEST] [OTHER]
55
Arguments:
66

77
src string The file to copy [required]
8-
dest string Destination to copy to [default default.txt]
9-
other int Something else [default 0]
8+
dest string Destination to copy to [default: default.txt]
9+
other int Something else [default: 0]
1010

1111
Options:
1212

testdata/snapshots/TestHelp/with_verbosity_count.snap.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Usage: test [OPTIONS] SRC [DEST]
55
Arguments:
66

77
src string The file to copy [required]
8-
dest string Destination to copy to [default destination.txt]
8+
dest string Destination to copy to [default: destination.txt]
99

1010
Options:
1111

0 commit comments

Comments
 (0)