Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 130491f

Browse filesBrowse files
hugovkdonBarbos
andauthored
[3.13] gh-130160: use .. program:: directive for documenting platform CLI (GH-133335) (#133341)
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
1 parent c9c0beb commit 130491f
Copy full SHA for 130491f

File tree

2 files changed

+38
-9
lines changed
Filter options

2 files changed

+38
-9
lines changed

‎Doc/library/cmdline.rst

Copy file name to clipboardExpand all lines: Doc/library/cmdline.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The following modules have a command-line interface.
2828
* :mod:`pdb`
2929
* :mod:`pickle`
3030
* :ref:`pickletools <pickletools-cli>`
31-
* :mod:`platform`
31+
* :ref:`platform <platform-cli>`
3232
* :mod:`poplib`
3333
* :ref:`profile <profile-cli>`
3434
* :mod:`pstats`

‎Doc/library/platform.rst

Copy file name to clipboardExpand all lines: Doc/library/platform.rst
+37-8Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
section.
1818

1919

20-
Cross Platform
20+
Cross platform
2121
--------------
2222

2323

@@ -188,7 +188,7 @@ Cross Platform
188188
:attr:`processor` is resolved late instead of immediately.
189189

190190

191-
Java Platform
191+
Java platform
192192
-------------
193193

194194

@@ -206,7 +206,7 @@ Java Platform
206206
and was only useful for Jython support.
207207

208208

209-
Windows Platform
209+
Windows platform
210210
----------------
211211

212212

@@ -240,7 +240,7 @@ Windows Platform
240240
.. versionadded:: 3.8
241241

242242

243-
macOS Platform
243+
macOS platform
244244
--------------
245245

246246
.. function:: mac_ver(release='', versioninfo=('','',''), machine='')
@@ -252,7 +252,7 @@ macOS Platform
252252
Entries which cannot be determined are set to ``''``. All tuple entries are
253253
strings.
254254

255-
iOS Platform
255+
iOS platform
256256
------------
257257

258258
.. function:: ios_ver(system='', release='', model='', is_simulator=False)
@@ -271,7 +271,7 @@ iOS Platform
271271
parameters.
272272

273273

274-
Unix Platforms
274+
Unix platforms
275275
--------------
276276

277277
.. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=16384)
@@ -287,7 +287,7 @@ Unix Platforms
287287
The file is read and scanned in chunks of *chunksize* bytes.
288288

289289

290-
Linux Platforms
290+
Linux platforms
291291
---------------
292292

293293
.. function:: freedesktop_os_release()
@@ -325,7 +325,7 @@ Linux Platforms
325325
.. versionadded:: 3.10
326326

327327

328-
Android Platform
328+
Android platform
329329
----------------
330330

331331
.. function:: android_ver(release="", api_level=0, manufacturer="", \
@@ -359,3 +359,32 @@ Android Platform
359359
<https://storage.googleapis.com/play_public/supported_devices.html>`__.
360360

361361
.. versionadded:: 3.13
362+
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.platform` with the *terse* argument set to ``True``.
381+
382+
.. option:: --nonaliased
383+
384+
Print platform information without system/OS name aliasing. This is
385+
equivalent to calling :func:`platform.platform` with the *aliased* argument
386+
set to ``True``.
387+
388+
You can also pass one or more positional arguments (``terse``, ``nonaliased``)
389+
to explicitly control the output format. These behave similarly to their
390+
corresponding options.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.