Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
2 changes: 1 addition & 1 deletion Doc/library/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following modules have a command-line interface.
* :mod:`pdb`
* :ref:`pickle <pickle-cli>`
* :ref:`pickletools <pickletools-cli>`
* :mod:`platform`
* :ref:`platform <platform-cli>`
* :mod:`poplib`
* :ref:`profile <profile-cli>`
* :mod:`pstats`
Expand Down
28 changes: 28 additions & 0 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,34 @@ Android Platform

.. versionadded:: 3.13

.. _platform-cli:

Command-line Usage
------------------

:mod:`platform` can also be invoked directly using the :option:`-m`
switch of the interpreter::

python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]

The following options are accepted:

.. program:: platform

.. option:: --terse

Print terse information about the platform. This is equivalent to
calling :func:`platform.platform` with the *terse* argument set to ``True``.

.. option:: --nonaliased

Print platform information without system/OS name aliasing. This is
equivalent to calling :func:`platform.platform` with the *aliased* argument
set to ``True``.

You can also pass one or more positional arguments (``terse``, ``nonaliased``)
to explicitly control the output format. These behave similarly to their
corresponding options.

Miscellaneous
-------------
Expand Down
Loading