Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@zacharysyoung
Copy link
Collaborator

@zacharysyoung zacharysyoung commented May 7, 2025

Addresses #83.

Print special help subcommand to to stdout for better readability/processing: since the user explicitly asks for help, make their life easier by printing to stdout.

bad/missing subcommand error, and subcommand -h usage still print to stderr.

Also, following the style of something like go test -h, which prints:

usage: go test [build/test flags] [packages] [build/test flags & test binary flags]
Run 'go help test' and 'go help testflag' for details.

A missing subcommand prints:

usage: gocsv help|version|<subcommand>
Run 'gocsv help' for a list of subcommands, and 'gocsv <subcommand> -h' for subcommand details.

and a bad subcommand (e.g., foo), prints:

error: invalid subcommand "foo"

usage: gocsv help|version|<subcommand>
Run 'gocsv help' for a list of subcommands, and 'gocsv <subcommand> -h' for subcommand details.

A bad/missing subcommand no longer prints the big usage list, which will likely obscure the error/problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant