-
Notifications
You must be signed in to change notification settings - Fork 44
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
refactor: Improve CLI error handling and fix small issues #649
Conversation
In general it looks really good Orphée. Only a few minor suggestion for now. I'll look more closely at the docs tomorrow :) |
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.
praise: Appreciate the cleaner error handling, and really appreciate the attention to the context objects, and being consistent with their usage via cmd.Context
instead of re-creating on each case.
Had a question regarding automatic vs manual arg length checking if len(args)
vs Args: cobra.ExactArgs(...)
I know that Fred also brought this point up, and I guess there is a divergence of preference.
To be clear, im all for the manual checking, assuming that the automatic checking via ExactArgs
isn't actually producing the usage string when it fails validation (incorrect number)
If the automatic checking does produce the usage string, i'd prefer to use that.
@jsimnz it's more control allowing to display usage help and specific error message. The alternative doesn't display a nice message. |
Gotcha, I figured the alternative would, in which case, I agree to these changes 👍 |
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.
👏
85a7ca9
to
cbca4ef
Compare
Codecov Report
@@ Coverage Diff @@
## develop #649 +/- ##
===========================================
- Coverage 57.32% 57.11% -0.22%
===========================================
Files 122 122
Lines 14753 14652 -101
===========================================
- Hits 8457 8368 -89
+ Misses 5573 5567 -6
+ Partials 723 717 -6
|
…ork#649) Resolves sourcenetwork#271 Resolves sourcenetwork#613 - adding license and copyright info to root command - general tidy - fix the command server-dump creating a new badger directory by itself - converted all commands to use "bubbling up" style error handling - all flags documentation to start with capital letters - revamp command texts - "controlled display of commands' Usage & erroring" - update in-repo command docs - usage of command tree's Context instead of command-local context
Relevant issue(s)
Resolves #271
Resolves #613
Description
Tasks
How has this been tested?
Manual...
Specify the platform(s) on which this was tested: