Skip to content

Commit c561f89

Browse files
committed
document the cli
1 parent 77c1768 commit c561f89

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"sphinx.ext.extlinks",
1414
"sphinx.ext.intersphinx",
1515
"sphinx.ext.viewcode",
16+
"sphinxcontrib.autoprogram",
1617
]
1718
ROOT_SRC_TREE_DIR = Path(__file__).parents[1]
1819

doc/config.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,12 @@ user can bypass the system's interpreter parser by defining the
849849
When the workaround is enabled, all tox-invoked text file executables will have
850850
their interpreter directive parsed by and explicitly executed by ``tox``.
851851

852+
cli
853+
===
854+
855+
.. autoprogram:: tox.cli:cli
856+
:prog: tox
857+
852858
Injected environment variables
853859
------------------------------
854860
tox will inject the following environment variables that you can use to test that your command is running within tox:

doc/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ Current features
160160

161161
* supports :ref:`using different / multiple PyPI index servers <multiindex>`
162162

163-
164163
.. toctree::
165164
:hidden:
166165

src/tox/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from tox.config import Parser, get_plugin_manager
2+
3+
4+
def cli_parser():
5+
parser = Parser()
6+
pm = get_plugin_manager(tuple())
7+
pm.hook.tox_addoption(parser=parser)
8+
return parser.argparser
9+
10+
11+
cli = cli_parser()

src/tox/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ def __setitem__(self, name, value):
343343

344344
@tox.hookimpl
345345
def tox_addoption(parser):
346-
# formatter_class=argparse.ArgumentDefaultsHelpFormatter)
347346
parser.add_argument(
348347
"--version",
349348
action="store_true",

0 commit comments

Comments
 (0)