Skip to content

Commit

Permalink
Add 'help' and '?' commands
Browse files Browse the repository at this point in the history
for printing the help text.
  • Loading branch information
dnephin committed Aug 23, 2021
1 parent 37116ff commit de90737
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/main.go
Expand Up @@ -128,6 +128,7 @@ Formats:
Commands:
tool tools for working with test2json output
help print this help next
`)
}

Expand Down
1 change: 1 addition & 0 deletions cmd/testdata/gotestsum-help-text
Expand Up @@ -32,3 +32,4 @@ Formats:

Commands:
tool tools for working with test2json output
help print this help next
2 changes: 2 additions & 0 deletions main.go
Expand Up @@ -27,6 +27,8 @@ func route(args []string) error {
name := args[0]
next, rest := cmd.Next(args[1:])
switch next {
case "help", "?":
return cmd.Run(name, []string{"--help"})
case "tool":
return tool.Run(name+" "+next, rest)
default:
Expand Down

0 comments on commit de90737

Please sign in to comment.