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

Fix global options swallowing arguments. #527

Merged
merged 1 commit into from May 2, 2015

Conversation

pocallaghan
Copy link
Contributor

The --skip-root-check and --skip-config options were both defined as
InputOption::VALUE_OPTIONAL. In this situation the option will be
assigned the value of an argument that is directly following it. In the
case of a command this is the command name itself, but this causes every
argument to shift along. Since these options are boolean switches, they
can be changed to InputOption::VALUE_NONE. Closes #521.

The --skip-root-check and --skip-config options were both defined as
InputOption::VALUE_OPTIONAL. In this situation the option will be
assigned the value of an argument that is directly following it. In the
case of a command this is the command name itself, but this causes every
argument to shift along. Since these options are boolean switches, they
can be changed to InputOption::VALUE_NONE. Closes netz98#521.
@pocallaghan
Copy link
Contributor Author

It's worth noting that --root-dir is also marked as VALUE_OPTIONAL, this doesn't make a lot of semantic sense, since the whole point of the option is to set a root directory. It would therefore probably make more sense as VALUE_REQUIRED. I didn't include this in the pull request purely because it doesn't really change the behaviour. As required or optional, it will swallow the command argument unless a value is specified.

cmuench added a commit that referenced this pull request May 2, 2015
Fix global options swallowing arguments.
@cmuench cmuench merged commit 2f04b3b into netz98:develop May 2, 2015
@cmuench
Copy link
Member

cmuench commented May 2, 2015

Thanks

cmuench added a commit that referenced this pull request May 3, 2015
@cmuench
Copy link
Member

cmuench commented May 3, 2015

@pocallaghan I tested the changes. The solution is to use $input->getParameterOption() to check against a global option.

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.

None yet

2 participants