Skip to content
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

config: return error on extra command line arguments (#3397) #3598

Merged
merged 2 commits into from
Oct 23, 2017

Conversation

magiconair
Copy link
Contributor

The consul agent command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an = when setting
boolean flags to true. -bootstrap true is not the same as
-bootstrap=true, for example.

Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.

Fixes #3397

@magiconair magiconair requested a review from slackpad October 20, 2017 10:03
@magiconair magiconair self-assigned this Oct 20, 2017
@magiconair magiconair added this to the 1.0.1 milestone Oct 20, 2017
Copy link
Contributor

@slackpad slackpad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The `consul agent` command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an `=` when setting
boolean flags to `true`. `-bootstrap true` is not the same as
`-bootstrap=true`, for example.

Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.

Fixes #3397
@magiconair magiconair force-pushed the issue-3397-error-with-extra-flags branch from c6b1b4b to b97ab36 Compare October 23, 2017 06:07
@magiconair magiconair merged commit ce935ce into master Oct 23, 2017
@magiconair magiconair deleted the issue-3397-error-with-extra-flags branch October 23, 2017 06:08
@magiconair magiconair restored the issue-3397-error-with-extra-flags branch October 23, 2017 07:57
magiconair added a commit that referenced this pull request Oct 23, 2017
…lags

The `consul agent` command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an `=` when setting
boolean flags to `true`. `-bootstrap true` is not the same as
`-bootstrap=true`, for example.

Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.

Fixes #3397
@magiconair magiconair deleted the issue-3397-error-with-extra-flags branch October 23, 2017 08:50
@magiconair
Copy link
Contributor Author

Reverted the rebased commit and re-merged as a proper merge commit.

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.

2 participants