-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli: Make "unknown sub-command" error clearer for empty subcommands #30727
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran `cockroach zone` to try and get the list of available sub-commands printed as help text, but ended up getting confused by what it printed: Error: unknown sub-command: Failed running "zone" I wasn't really sure what this meant. Now it'll print: Error: unknown sub-command: "" Failed running "zone" It may also be better to say something like "unknown or missing sub-command". Let me know if you'd prefer that. Release note: None
What you have now LGTM The other suggestion LGTM too! Pick your preferred outcome. Either is better than the status quo. Thanks for finding this out. |
Thanks for the quick review. Also, I double checked, and not printing the subcommands is a regression since 2.0. I'll open a separate issue, but do you have any available time to look into it?
|
bors r+ |
craig bot
pushed a commit
that referenced
this pull request
Sep 27, 2018
30530: opt: Fix bug in function interning. r=andy-kimball a=andy-kimball Some builtin function overloads have a return type that's dependent on the type of its parameters (e.g. unnest). This means that two FuncOpDef structs with the same overload can have different Type fields. Therefore, the FuncOpDef interning needs to incorporate that type. Release note: None 30608: sqlbase: introduce RowFetcher.Reset() r=jordanlewis a=jordanlewis In preparation for pooling tableReader objects and reusing internal allocated memory. Broken out from #30556. Release note: None 30727: cli: Make "unknown sub-command" error clearer for empty subcommands r=a-robinson a=a-robinson I ran `cockroach zone` to try and get the list of available sub-commands printed as help text, but ended up getting confused by what it printed: Error: unknown sub-command: Failed running "zone" I wasn't really sure what this meant. Now it'll print: Error: unknown sub-command: "" Failed running "zone" It may also be better to say something like "unknown or missing sub-command". Let me know if you'd prefer that. Release note: None --- Along these lines, how come the available subcommands don't get printed anymore? I can't get them listed either with `cockroach zone` or `cockroach zone -h`. I could have sworn we used to list them. Did cobra change? Maybe I'm conflating cockroach with other tools. It'd certainly be nice if we did, though. Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com> Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com> Co-authored-by: Alex Robinson <alexdwanerobinson@gmail.com>
Build succeeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran
cockroach zone
to try and get the list of available sub-commandsprinted as help text, but ended up getting confused by what it printed:
Error: unknown sub-command:
Failed running "zone"
I wasn't really sure what this meant. Now it'll print:
Error: unknown sub-command: ""
Failed running "zone"
It may also be better to say something like "unknown or missing
sub-command". Let me know if you'd prefer that.
Release note: None
Along these lines, how come the available subcommands don't get printed anymore? I can't get them listed either with
cockroach zone
orcockroach zone -h
. I could have sworn we used to list them. Did cobra change? Maybe I'm conflating cockroach with other tools. It'd certainly be nice if we did, though.