From d25ec3624e699ee4b16fcb06c372a1a6b0a3e12b Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 21 Oct 2015 11:02:27 +0200 Subject: [PATCH 1/2] Fixed an issue with command option shortcuts --- components/console/console_arguments.rst | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/components/console/console_arguments.rst b/components/console/console_arguments.rst index 894680b684a..fe6074b9ccc 100644 --- a/components/console/console_arguments.rst +++ b/components/console/console_arguments.rst @@ -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`` +``-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:: @@ -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/ From 4a6a5a7a1fb2fcb11467958e17ee7a8341bce658 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 23 Oct 2015 13:12:52 +0200 Subject: [PATCH 2/2] Fixed table alignment --- components/console/console_arguments.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/components/console/console_arguments.rst b/components/console/console_arguments.rst index fe6074b9ccc..fd3474c8ca2 100644 --- a/components/console/console_arguments.rst +++ b/components/console/console_arguments.rst @@ -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`` +===================== ========= ============ ============ +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"`` -===================== ========= =========== ============ +``-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::