Skip to content

Commit

Permalink
Merge pull request #94 from juju/JUJU-3454_print_examples_in_help
Browse files Browse the repository at this point in the history
[JUJU-3454] Print examples in help
  • Loading branch information
juanmanuel-tirado authored Apr 5, 2023
2 parents 407be40 + 5387481 commit 0f32311
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ func (i *Info) HelpWithSuperFlags(superF *gnuflag.FlagSet, f *gnuflag.FlagSet) [
if len(i.Aliases) > 0 {
fmt.Fprintf(buf, "\nAliases: %s\n", strings.Join(i.Aliases, ", "))
}
if len(i.Examples) > 0 {
fmt.Fprintf(buf, "\nExamples:\n%s", i.Examples)
}

return buf.Bytes()
}

Expand Down

0 comments on commit 0f32311

Please sign in to comment.