Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func writeArgumentsSection(cmd *Command, s *strings.Builder) error {
for _, arg := range cmd.args {
line := fmt.Sprintf(" %s\t%s\t%s\t[required]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage())
if arg.Default() != "" {
line = fmt.Sprintf(" %s\t%s\t%s\t[default %s]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage(), arg.Default())
line = fmt.Sprintf(" %s\t%s\t%s\t[default: %s]", style.Bold.Text(arg.Name()), arg.Type(), arg.Usage(), arg.Default())
}

fmt.Fprintln(tw, line)
Expand Down
4 changes: 2 additions & 2 deletions testdata/snapshots/TestHelp/with_named_arguments.snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Usage: test [OPTIONS] SRC [DEST] [OTHER]
Arguments:

src string The file to copy [required]
dest string Destination to copy to [default default.txt]
other int Something else [default 0]
dest string Destination to copy to [default: default.txt]
other int Something else [default: 0]

Options:

Expand Down
2 changes: 1 addition & 1 deletion testdata/snapshots/TestHelp/with_verbosity_count.snap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Usage: test [OPTIONS] SRC [DEST]
Arguments:

src string The file to copy [required]
dest string Destination to copy to [default destination.txt]
dest string Destination to copy to [default: destination.txt]

Options:

Expand Down
Loading