-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
shell shows error and usage when given extra parameters #9095
shell shows error and usage when given extra parameters #9095
Conversation
cmd/influx/main.go
Outdated
@@ -108,6 +109,13 @@ Examples: | |||
} | |||
fs.Parse(os.Args[1:]) | |||
|
|||
argsNotParsed := os.Args[len(os.Args)-fs.NArg():] | |||
if len(argsNotParsed) > 0 { |
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.
This block should use flag.Args()
instead.
https://golang.org/pkg/flag/#Arg
Args returns the non-flag command-line arguments.
@stop-start would you mind adding a line like
to the 1.5.0 / Bugfixes section of CHANGELOG.md? |
@mark-rushakoff Done |
Thanks @stop-start! |
Thanks @mark-rushakoff, it's my second pull request but first looked at and approved! |
The PR number in CHANGELOG.md is the wrong one, though. 9065 instead of 9095. |
Good catch @Luit, that was a typo on my part. Care to open a small PR to fix it? |
I opened a PR to fix it in #9182. |
Fixes #8593
When try to launch the shell with arguments the shell won't launch, instead will show an error (with the unknown args) as well as the usage.
Required for all non-trivial PRs