-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Support binary / negatable options #39642
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
Conversation
….g. --foo and --no-foo.
I would only allow the |
20fa14c
to
89a7e89
Compare
src/Symfony/Component/Console/Tests/Command/ListCommandTest.php
Outdated
Show resolved
Hide resolved
497f03c
to
82d2a9f
Compare
82d2a9f
to
0c54aa7
Compare
Can you please make fabbot happy? 😊 |
I think, fabbot is a false positive here. |
Indeed it looks weird 🧐 |
Jérémy thanks for this contribution. As a super minor comment: is "negatable" the best word to describe this? Could we use "boolean" like the Golang boolean flags? |
src/Symfony/Component/Console/Tests/Command/ListCommandTest.php
Outdated
Show resolved
Hide resolved
I like the Boolean naming a lot! Thank you for the proposal Javier 😃 |
0c54aa7
to
ca2d46a
Compare
I also Replaced
|
You're correct about (and sorry for being nitpicky about this, I just remember this as it was my first big PR to Symfony: #13220) |
ad5f315
to
95bfea2
Compare
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.
Small nitpick before merging
95bfea2
to
1a9a3c3
Compare
Thank you @greg-1-anderson. |
Thanks @jderusse also :) |
Is a backport to Symfony 4.4.x permissible? |
@greg-1-anderson no. New features are never backported in patch releases. |
@@ -1033,8 +1033,7 @@ protected function getDefaultInputDefinition() | |||
new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), | |||
new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), | |||
new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), | |||
new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), | |||
new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), |
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.
Why was this flag removed?
@jderusse @fabpot the |
Well, was Lavaral checking the |
@driesvints this is not equivalent. |
what you really need to check is |
@stof never have had to do that before. This has always worked like this. I still feel this is a breaking change, sorry. |
@stof I can't seem to find any docs about |
@driesvints there is no documentation about accessing
call |
Thanks @stof, that was clear 👍 |
This PR take over #26292 to introduce a new option mode
NEGATABLE
that ease creation of option and their negation (ie.--foo
,--no-foo
)Negated options applies only to flag options (
VALUE_NONE
)