-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix(cmd): fix logging of help message #395
Conversation
Signed-off-by: Asra Ali <asraa@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're nitpicking what goes where...I build tuf
at this PR and I see:
cmd | output | stream | correct |
---|---|---|---|
tuf |
usage | stdout | ❌* |
tuf badcommand |
error | stderr | ✅ |
tuf --badarg |
usage | stderr | ✅ |
tuf help |
help | stderr | ✅ |
tuf --help |
usage | stderr | ✅ |
tuf init --help |
help | stdout | ✅ |
tuf init --badarg |
usage | stdout | ❌ |
* I think this one's debatable: is the user explicitly asking for the usage information? IMO no, they've invoked tuf
incorrectly (if tuf
had a no-args mode, it could be a correct usage)
Can we fix those too?
Just looked into this further, since this was annoying to deal with: BOTH the incorrect that triggers when the user gives bad input: which either means no command here, or a bad input argument. Any maintainer have any context why we're not using https://github.com/docopt/docopt.go? Was it too complex a dependency? |
Looks like this decision was made in 2015 and not revisited (also, https://github.com/docopt/docopt.go was still pretty new in 2015). If a different library has features we need, I think we should switch. |
Okay, I don't want to block this PR on you totally switching over our CLI engine.
This is all speculation/hearsay, but IIRC Flynn was a big go-tuf user/contributor so a long time ago we bought into their go stack. However Flynn is sadly unmaintained so a lot of that is relatively dated. I think a switch to more mainstream dependencies in place of the Flynn ones would be a good idea. |
I'll create a follow up good first issue: it would be great to move over to another managing library then |
Signed-off-by: Asra Ali asraa@google.com
Fixes comments of #385
Please fill in the fields below to submit a pull request. The more information that is provided, the better.
Fixes #
Release Notes:
Types of changes:
Description of the changes being introduced by the pull request:
Please verify and check that the pull request fulfills the following requirements: