aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-06-09 11:15:09 +0200
committerHarald Welte <laforge@osmocom.org>2023-06-09 11:50:18 +0200
commitf422eb18861906fbc544371496d38b4c95dde09f (patch)
treebc3574a4e8f1a78d1c5ff5d953a1265e39a9b614
parentf9a5ba5e0f107458d7dfd68ce96a1b6c0d6096ea (diff)
Add ".py" suffix to sphinx-argparse generated docs
This is important to produce the right command syntax when generating command line reference in the user manual. However, we shouldn't add this kludge to the individual programs, but only to the documentation using the :prog: syntax. Change-Id: I2ec7ab00c63d5d386f187e54755c71ffc2dce429
-rw-r--r--docs/legacy.rst1
-rw-r--r--docs/shell.rst1
-rwxr-xr-xpySim-read.py3
-rwxr-xr-xpySim-shell.py2
4 files changed, 4 insertions, 3 deletions
diff --git a/docs/legacy.rst b/docs/legacy.rst
index d93358f..0961d17 100644
--- a/docs/legacy.rst
+++ b/docs/legacy.rst
@@ -98,3 +98,4 @@ pySim-read usage
.. argparse::
:module: pySim-read
:func: option_parser
+ :prog: pySim-read.py
diff --git a/docs/shell.rst b/docs/shell.rst
index e13d054..ef08fcf 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -35,6 +35,7 @@ pySim-shell has a variety of command line arguments to control
.. argparse::
:module: pySim-shell
:func: option_parser
+ :prog: pySim-shell.py
Usage Examples
--------------
diff --git a/pySim-read.py b/pySim-read.py
index ddc193a..f80509c 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -40,8 +40,7 @@ from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, dec_msisdn
from pySim.utils import format_xplmn_w_act, dec_st
from pySim.utils import h2s, format_ePDGSelection
-option_parser = argparse.ArgumentParser(prog='pySim-read',
- description='Legacy tool for reading some parts of a SIM card',
+option_parser = argparse.ArgumentParser(description='Legacy tool for reading some parts of a SIM card',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
argparse_add_reader_args(option_parser)
diff --git a/pySim-shell.py b/pySim-shell.py
index 3f0818a..c6782d4 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -949,7 +949,7 @@ class Proact(ProactiveHandler):
-option_parser = argparse.ArgumentParser(prog='pySim-shell', description='interactive SIM card shell',
+option_parser = argparse.ArgumentParser(description='interactive SIM card shell',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
argparse_add_reader_args(option_parser)