Skip to content

Commit a0de96c

Browse files
committed
use .. program:: directive for documenting platform CLI
1 parent 77c391a commit a0de96c

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

Doc/library/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following modules have a command-line interface.
2727
* :mod:`pdb`
2828
* :ref:`pickle <pickle-cli>`
2929
* :ref:`pickletools <pickletools-cli>`
30-
* :mod:`platform`
30+
* :ref:`platform <platform-cli>`
3131
* :mod:`poplib`
3232
* :ref:`profile <profile-cli>`
3333
* :mod:`pstats`

Doc/library/platform.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,33 @@ Android Platform
360360

361361
.. versionadded:: 3.13
362362

363+
.. _platform-cli:
364+
365+
Command-line Usage
366+
------------------
367+
368+
:mod:`platform` can also be invoked directly using the :option:`-m`
369+
switch of the interpreter::
370+
371+
python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]
372+
373+
The following options are accepted:
374+
375+
.. program:: platform
376+
377+
.. option:: --terse
378+
379+
Print terse information about the platform. This is equivalent to
380+
calling :func:`platform` with the *terse* argument set to ``True``.
381+
382+
.. option:: --nonaliased
383+
384+
Print information without system/OS name aliasing. This is equivalent to
385+
calling :func:`platform` with the *aliased* argument set to ``True``.
386+
387+
You can also pass one or more positional arguments (``terse``, ``nonaliased``)
388+
to explicitly control the output format. These behave similarly to their
389+
corresponding options.
363390

364391
Miscellaneous
365392
-------------

0 commit comments

Comments
 (0)