diff options
| -rw-r--r-- | docs/pscripts/pdistreport.rst | 2 | ||||
| -rw-r--r-- | pyramid/scripts/pdistreport.py | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/docs/pscripts/pdistreport.rst b/docs/pscripts/pdistreport.rst index 8eebaf8cb..f88ea7fe1 100644 --- a/docs/pscripts/pdistreport.rst +++ b/docs/pscripts/pdistreport.rst @@ -6,7 +6,7 @@ ``pdistreport`` --------------- -.. autoprogram:: pyramid.scripts.pdistreport:parser +.. autoprogram:: pyramid.scripts.pdistreport:get_parser() :prog: pdistreport .. seealso:: :ref:`showing_distributions` diff --git a/pyramid/scripts/pdistreport.py b/pyramid/scripts/pdistreport.py index 64837a36c..6622b4bd8 100644 --- a/pyramid/scripts/pdistreport.py +++ b/pyramid/scripts/pdistreport.py @@ -10,12 +10,16 @@ def out(*args): # pragma: no cover sys.stdout.write(' ') sys.stdout.write('\n') +def get_parser(): + _parser = argparse.ArgumentParser( + usage="%(prog)s", + description="Show Python distribution versions and locations in use") + return _parser + def main(argv=sys.argv, pkg_resources=pkg_resources, platform=platform.platform, out=out): # all args except argv are for unit testing purposes only - parser = argparse.ArgumentParser( - usage="%(prog)s", - description="Show Python distribution versions and locations in use") + parser = get_parser() parser.parse_args(argv[1:]) packages = [] for distribution in pkg_resources.working_set: |
