Skip to content

Fixed an issue with command option shortcuts #5820

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions components/console/console_arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ is required. It can be separated from the option name either by spaces or
except that it doesn't require a value. Have a look at the following table
to get an overview of the possible ways to pass options:

===================== ========= =========== ============
Input ``foo`` ``bar`` ``cat``
===================== ========= =========== ============
``--bar=Hello`` ``false`` ``"Hello"`` ``null``
``--bar Hello`` ``false`` ``"Hello"`` ``null``
``-b=Hello`` ``false`` ``"Hello"`` ``null``
``-b Hello`` ``false`` ``"Hello"`` ``null``
``-bHello`` ``false`` ``"Hello"`` ``null``
``-fcWorld -b Hello`` ``true`` ``"Hello"`` ``"World"``
``-cfWorld -b Hello`` ``false`` ``"Hello"`` ``"fWorld"``
``-cbWorld`` ``false`` ``null`` ``"bWorld"``
===================== ========= =========== ============
===================== ========= =========== ============
Input ``foo`` ``bar`` ``cat``
===================== ========= =========== ============
``--bar=Hello`` ``false`` ``"Hello"`` ``null``
``--bar Hello`` ``false`` ``"Hello"`` ``null``
``-b=Hello`` ``false`` ``"=Hello"`` ``null``
Copy link
Member

Choose a reason for hiding this comment

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

The third column is now longer so you need to adjust all other lines too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Fixed. Thanks.

``-b Hello`` ``false`` ``"Hello"`` ``null``
``-bHello`` ``false`` ``"Hello"`` ``null``
``-fcWorld -b Hello`` ``true`` ``"Hello"`` ``"World"``
``-cfWorld -b Hello`` ``false`` ``"Hello"`` ``"fWorld"``
``-cbWorld`` ``false`` ``null`` ``"bWorld"``
===================== ========= =========== ============

Things get a little bit more tricky when the command also accepts an optional
argument::
Expand All @@ -77,15 +77,15 @@ arguments. Have a look at the fifth example in the following table where it
is used to tell the command that ``World`` is the value for ``arg`` and not
the value of the optional ``cat`` option:

============================== ================= =========== ===========
Input ``bar`` ``cat`` ``arg``
============================== ================= =========== ===========
``--bar Hello`` ``"Hello"`` ``null`` ``null``
``--bar Hello World`` ``"Hello"`` ``null`` ``"World"``
``--bar "Hello World"`` ``"Hello World"`` ``null`` ``null``
``--bar Hello --cat World`` ``"Hello"`` ``"World"`` ``null``
``--bar Hello --cat -- World`` ``"Hello"`` ``null`` ``"World"``
``-b Hello -c World`` ``"Hello"`` ``"World"`` ``null``
============================== ================= =========== ===========
============================== ================= =========== ===========
Input ``bar`` ``cat`` ``arg``
============================== ================= =========== ===========
``--bar Hello`` ``"Hello"`` ``null`` ``null``
``--bar Hello World`` ``"Hello"`` ``null`` ``"World"``
``--bar "Hello World"`` ``"Hello World"`` ``null`` ``null``
``--bar Hello --cat World`` ``"Hello"`` ``"World"`` ``null``
``--bar Hello --cat -- World`` ``"Hello"`` ``null`` ``"World"``
``-b Hello -c World`` ``"Hello"`` ``"World"`` ``null``
============================== ================= =========== ===========

.. _docopt: http://docopt.org/