diff --git a/cmd/help.go b/cmd/help.go index f42bc05..a7058fa 100644 --- a/cmd/help.go +++ b/cmd/help.go @@ -21,7 +21,7 @@ Options:{{range .Options}} func helpCmd(cli.Args, config.Config) { tmpl := template.Must(template.New("--help").Parse(helpUsage)) - tmpl.Execute(os.Stderr, cli.Registry) + tmpl.Execute(os.Stdout, cli.Registry) } func init() { diff --git a/cmd/help_test.go b/cmd/help_test.go new file mode 100644 index 0000000..cea9eae --- /dev/null +++ b/cmd/help_test.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/gsamokovarov/jump/cli" +) + +func ExampleHelpCmd() { + helpCmd(cli.Args{}, nil) + + // Output: + // Usage: jump [COMMAND ...] + // + // Jump to a fuzzy-matched directory passed as an argument. + // + // Commands: + // cd Fuzzy match a directory to jump to. + // chdir Update the score of directory during chdir. + // clean Cleans the database of inexisting entries. + // hint Hints relevant paths for jumping. + // pin Pin a directory to a search term. + // shell Display a shell integration script. + // top List the directories as they are scored. + // + // Options: + // --help Show this screen. + // --version Show version. +}