8000 special help subcmd prints to stdout; small improvements for args/flag errors by zacharysyoung · Pull Request #84 · aotimme/gocsv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

special help subcmd prints to stdout; small improvements for args/flag errors #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
0