diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2023-10-11 20:47:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 20:47:38 (GMT) |
commit | e6c53dd08535076fc60e9295bf46a2b7e615e2f3 (patch) | |
tree | 2031bb4c62154c7252be379de87b99a929100300 /Doc/library/dis.rst | |
parent | 989aa447d79c010861b19053fad1204429aede38 (diff) | |
download | cpython-e6c53dd08535076fc60e9295bf46a2b7e615e2f3.zip cpython-e6c53dd08535076fc60e9295bf46a2b7e615e2f3.tar.gz cpython-e6c53dd08535076fc60e9295bf46a2b7e615e2f3.tar.bz2 |
[3.12] gh-108826: Document `dis` module CLI and rename `_test` function to `main` (#108827) (#110681)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index b559b08..ef016c1 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -63,6 +63,28 @@ the following command can be used to display the disassembly of (The "2" is a line number). +.. _dis-cli: + +Command-line interface +---------------------- + +The :mod:`dis` module can be invoked as a script from the command line: + +.. code-block:: sh + + python -m dis [-h] [infile] + +The following options are accepted: + +.. program:: dis + +.. cmdoption:: -h, --help + + Display usage and exit. + +If :file:`infile` is specified, its disassembled code will be written to stdout. +Otherwise, disassembly is performed on compiled source code recieved from stdin. + Bytecode analysis ----------------- |