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

Amend --skip-foo fix with a trailing option #682

Merged
merged 2 commits into from
Sep 26, 2019
Merged

Amend --skip-foo fix with a trailing option #682

merged 2 commits into from
Sep 26, 2019

Conversation

deivid-rodriguez
Copy link
Contributor

The fix in bdb43eb unintentioanlly dropped support for specifying things like --skip-foo=f or --skip-foo true. In the first case, for no good reason, in the second, because "true" is now interpreted as a command option, not as a flag.

This PR restores support for those, so that arguments right after --skip-foo flags will never be interpreted as the flag's value, unless they are "true", "t", "false", or "f".

So

my_program --skip-foo true

means

"run my_program without arguments and the 'foo' flag unset".

whereas

my_program --skip-foo asdf

means

"run my_program with argument 'asdf' and the 'foo' flag unset".

By doing this, we still fix what #679 intended to fix, but still retain maximum backwards compatibility and flexibility.

This is so that the `current_is_option?` method properly matches its own
documentation, and consistently returns a pair of booleans.
The fix in bdb43eb unintentioanlly dropped support for specifying things
like `--skip-foo=f` or `--skip-foo true`. In the first case, for no good
reason, in the second, because "true" is now interpreted as a command
option, not as a flag.

This commit restores support for those, so that arguments right after
`--skip-foo` flags will never be interpreted as the flag's value, unless
they are "true", "t", "false", or "f".

So

`my_program --skip-foo true`

means

"run my_program without arguments and the 'foo' flag unset".

whereas

`my_program --skip-foo asdf`

means

"run my_program with argument 'asdf' and the 'foo' flag unset"
@deivid-rodriguez deivid-rodriguez changed the title Ammend --skip-foo fix with a trailing option Amend --skip-foo fix with a trailing option Sep 26, 2019
@rafaelfranca rafaelfranca merged commit 1a2d64d into rails:master Sep 26, 2019
@deivid-rodriguez deivid-rodriguez deleted the ammend_no_or_skip_with_trailing_option_fix branch September 26, 2019 20:39
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