You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/contributor/humaninterfaceguide.rst
+43-37Lines changed: 43 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,14 +117,14 @@ interface to the user, not the user to the interface.
117
117
118
118
Commands should be discoverable via the interface itself.
119
119
120
-
To determine a list of available commands, use the :code:`-h` or
121
-
:code:`--help` options:
120
+
To determine a list of available commands, use the ``-h`` or
121
+
``--help`` options:
122
122
123
123
.. code-block:: bash
124
124
125
125
$ openstack --help
126
126
127
-
For help with an individual command, use the :code:`help` command:
127
+
For help with an individual command, use the ``help`` command:
128
128
129
129
.. code-block:: bash
130
130
@@ -167,7 +167,7 @@ Command Structure
167
167
168
168
OpenStackClient has a consistent and predictable format for all of its commands.
169
169
170
-
* The top level command name is :code:`openstack`
170
+
* The top level command name is ``openstack``
171
171
* Sub-commands take the form:
172
172
173
173
.. code-block:: bash
@@ -193,50 +193,56 @@ invocation regardless of action to be performed. They include authentication
193
193
credentials and API version selection. Most global options have a corresponding
194
194
environment variable that may also be used to set the value. If both are present,
195
195
the command-line option takes priority. The environment variable names are derived
196
-
from the option name by dropping the leading dashes ('--'), converting each embedded
197
-
dash ('-') to an underscore ('_'), and converting to upper case.
196
+
from the option name by dropping the leading dashes (``--``), converting each embedded
197
+
dash (``-``) to an underscore (``_``), and converting to upper case.
198
198
199
199
* Global options shall always have a long option name, certain common options may
200
200
also have short names. Short names should be reserved for global options to limit
201
201
the potential for duplication and multiple meanings between commands given the
202
202
limited set of available short names.
203
-
* All long options names shall begin with two dashes ('--') and use a single dash
204
-
('-') internally between words (:code:`--like-this`). Underscores ('_') shall not
203
+
204
+
* All long options names shall begin with two dashes (``--``) and use a single dash
205
+
(``-`` internally between words (``--like-this``). Underscores (``_``) shall not
205
206
be used in option names.
207
+
206
208
* Authentication options conform to the common CLI authentication guidelines in
207
209
:ref:`authentication`.
208
210
209
-
For example, :code:`--os-username` can be set from the environment via
210
-
:code:`OS_USERNAME`.
211
+
For example, ``--os-username`` can be set from the environment via
212
+
``OS_USERNAME``.
211
213
212
-
--help
213
-
++++++
214
+
``--help``
215
+
++++++++++
214
216
215
-
The standard :code:`--help` global option displays the documentation for invoking
217
+
The standard ``--help`` global option displays the documentation for invoking
216
218
the program and a list of the available commands on standard output. All other
217
219
options and commands are ignored when this is present. The traditional short
218
-
form help option (:code:`-h`) is also available.
220
+
form help option (``-h``) is also available.
219
221
220
-
--version
221
-
+++++++++
222
+
``--version``
223
+
+++++++++++++
222
224
223
-
The standard :code:`--version` option displays the name and version on standard
225
+
The standard ``--version`` option displays the name and version on standard
224
226
output. All other options and commands are ignored when this is present.
225
227
226
228
Command Object(s) and Action
227
229
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228
230
229
-
Commands consist of an object described by one or more words followed by an action. Commands that require two objects have the primary object ahead of the action and the secondary object after the action. Any positional arguments identifying the objects shall appear in the same order as the objects. In badly formed English it is expressed as "(Take) object1 (and perform) action (using) object2 (to it)."
231
+
Commands consist of an object described by one or more words followed by an
232
+
action. Commands that require two objects have the primary object ahead of the
233
+
action and the secondary object after the action. Any positional arguments
234
+
identifying the objects shall appear in the same order as the objects. In
235
+
badly formed English it is expressed as "(Take) object-1 (and perform) action
236
+
(using) object-2 (to it)."::
230
237
231
238
<object-1> <action> [<object-2>]
232
239
233
240
Examples:
234
241
235
-
* :code:`group add user <group> <user>`
236
-
* :code:`volume type list` # Note that :code:`volume type` is a two-word
237
-
single object
242
+
* ``group add user <group> <user>``
243
+
* ``volume type list`` (note that ``volume type`` is a two-word single object)
238
244
239
-
The :code:`help` command is unique as it appears in front of a normal command
245
+
The ``help`` command is unique as it appears in front of a normal command
240
246
and displays the help text for that command rather than execute it.
241
247
242
248
Object names are always specified in command in their singular form. This is
@@ -256,35 +262,35 @@ meaning across multiple commands.
256
262
Option Forms
257
263
++++++++++++
258
264
259
-
* **boolean**: boolean options shall use a form of :code:`--<true>|--<false>`
260
-
(preferred) or :code:`--<option>|--no-<option>`. For example, the
261
-
:code:`enabled` state of a project is set with :code:`--enable|--disable`.
265
+
* **boolean**: boolean options shall use a form of ``--<true>|--<false>``
266
+
(preferred) or ``--<option>|--no-<option>``. For example, the
267
+
``enabled`` state of a project is set with ``--enable|--disable``.
262
268
263
269
Command Output
264
270
--------------
265
271
266
272
The default command output is pretty-printed using the Python
267
-
:code:`prettytable` module.
273
+
``prettytable`` module.
268
274
269
-
Machine-parsable output format may be specified with the :code:`--format`
270
-
option to :code:`list` and :code:`show` commands. :code:`list` commands
271
-
have an option (:code:`--format csv`) for CSV output and :code:`show` commands
272
-
have an option (:code:`--format shell`) for the shell variable assignment
273
-
syntax of :code:`var="value"`. In both cases, all data fields are quoted with `"`
275
+
Machine-parsable output format may be specified with the ``--format``
276
+
option to ``list`` and ``show`` commands. ``list`` commands
277
+
have an option (``--format csv``) for CSV output and ``show`` commands
278
+
have an option (``--format shell``) for the shell variable assignment
279
+
syntax of ``var="value"``. In both cases, all data fields are quoted with ``"``
274
280
275
281
Help Commands
276
282
-------------
277
283
278
284
The help system is considered separately due to its special status
279
285
among the commands. Rather than performing tasks against a system, it
280
286
provides information about the commands available to perform those
281
-
tasks. The format of the :code:`help` command therefore varies from the
282
-
form for other commands in that the :code:`help` command appears in front
287
+
tasks. The format of the ``help`` command therefore varies from the
288
+
form for other commands in that the ``help`` command appears in front
283
289
of the first object in the command.
284
290
285
-
The options :code:`--help` and :code:`-h` display the global options and a
291
+
The options ``--help`` and ``-h`` display the global options and a
286
292
list of the supported commands. Note that the commands shown depend on the API
287
-
versions that are in effect; i.e. if :code:`--os-identity-api-version=3` is
293
+
versions that are in effect; i.e. if ``--os-identity-api-version=3`` is
288
294
present Identity API v3 commands are shown.
289
295
290
296
Examples
@@ -342,7 +348,7 @@ Using environment variables:
342
348
Machine Output Format
343
349
---------------------
344
350
345
-
Using the csv output format with a list command:
351
+
Using the CSV output format with a list command:
346
352
347
353
.. code-block:: bash
348
354
@@ -351,7 +357,7 @@ Using the csv output format with a list command:
0 commit comments