-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Clarify how to use short options with values. #9387
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
Adds a brief description of the correct syntax for short options that take values.
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.
@greg-1-anderson thanks for contributing this clarification and for your help in the related code issue. I like your proposal, but I feel like it's missing some information. If it's correct, what do you think about expanding your original description like this:
Note that to comply with the `docopt standard`_, long options can specify their
values after a white space or an ``=`` sign (e.g. ``--iterations 5`` or
``--iterations=5``), but short options can only use white spaces or no
separation at all (e.g. ``-i 5`` or ``-i5``).
.. _`docopt standard`: http://docopt.org/
@javiereguiluz I like your improvement. There is one problem that remains, though, and that is that Symfony fetches the command name via Perhaps this should be explained in the documentation as well? I'll try taking a pass a this. |
Add link to docopt standard and describe Symfony limitation in using spaces in option name/value pairs.
…erson, javiereguiluz) This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #9387). Discussion ---------- Clarify how to use short options with values. Adds a brief description of the correct syntax for short options that take values. Related to symfony/symfony#26378 Commits ------- 926461a Removed a duplicated content 194e541 Minor tweaks 2eddcf1 Clarify Symfony Console option conventions 2cf4122 Wrap long lines f4b77be Clarify how to use short options with values.
@greg-1-anderson thanks for helping us improve the docs and congrats on your first Symfony Docs contribution. It was a really nice first contribution! Note: we merged it on 2.7 branch, the oldest maintained branch. That's why GitHub displays it as closed instead of merged, but it's merged. |
@javiereguiluz , @greg-1-anderson
or
If no command is provided these forms does not work as well. So in the end we have:
that are working only. |
@Neirda24 This is explained in the |
No I mean if you don't specify any command it won't work. It might be good to add it in the
|
@Neirda24 First off, I think you might have a typo above. Did you mean to say that the things that always work are:
n.b. no space in short option. My opinion is that the current version of the docs are unambiguous, but things can always be improved. I think the best thing to do to further improve the text would be to open a new PR with the suggested changes. |
@greg-1-anderson . Yeah sorry for my typo. Agreed. Thanks |
Adds a brief description of the correct syntax for short options that take values.
Related to symfony/symfony#26378