From 6293d331046c78e27a0065d39a5277040391dd2d Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 6 Dec 2016 00:14:00 -0800 Subject: use ArgumentParser's default usage, specify prog argument --- pyramid/scripts/pdistreport.py | 2 +- pyramid/scripts/prequest.py | 2 +- pyramid/scripts/proutes.py | 5 ++--- pyramid/scripts/pshell.py | 2 +- pyramid/scripts/ptweens.py | 2 +- pyramid/scripts/pviews.py | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pyramid/scripts/pdistreport.py b/pyramid/scripts/pdistreport.py index e80ea20b6..e5928bde4 100644 --- a/pyramid/scripts/pdistreport.py +++ b/pyramid/scripts/pdistreport.py @@ -12,7 +12,7 @@ def out(*args): # pragma: no cover def get_parser(): parser = argparse.ArgumentParser( - usage="%(prog)s", + prog="pdistreport", description="Show Python distribution versions and locations in use") return parser diff --git a/pyramid/scripts/prequest.py b/pyramid/scripts/prequest.py index 9e807896d..84e84e1c8 100644 --- a/pyramid/scripts/prequest.py +++ b/pyramid/scripts/prequest.py @@ -47,7 +47,7 @@ class PRequestCommand(object): """ parser = argparse.ArgumentParser( - usage="%(prog)s config_uri path_info [args/options]", + prog="prequest", description=textwrap.dedent(description) ) parser.add_argument( diff --git a/pyramid/scripts/proutes.py b/pyramid/scripts/proutes.py index 640cd20a3..e745e19fd 100644 --- a/pyramid/scripts/proutes.py +++ b/pyramid/scripts/proutes.py @@ -247,10 +247,9 @@ class PRoutesCommand(object): """ bootstrap = (bootstrap,) stdout = sys.stdout - usage = '%prog config_uri' - ConfigParser = configparser.ConfigParser # testing + ConfigParser = configparser.ConfigParser # testing parser = argparse.ArgumentParser( - usage, + prog="proutes", description=textwrap.dedent(description) ) parser.add_argument('-g', '--glob', diff --git a/pyramid/scripts/pshell.py b/pyramid/scripts/pshell.py index 7e00eeaac..4289f10c4 100644 --- a/pyramid/scripts/pshell.py +++ b/pyramid/scripts/pshell.py @@ -45,7 +45,7 @@ class PShellCommand(object): pkg_resources = pkg_resources # for testing parser = argparse.ArgumentParser( - usage="%(prog)s config_uri", + prog="pshell", description=textwrap.dedent(description) ) parser.add_argument('-p', '--python-shell', diff --git a/pyramid/scripts/ptweens.py b/pyramid/scripts/ptweens.py index 3f8c9871e..ed91757ab 100644 --- a/pyramid/scripts/ptweens.py +++ b/pyramid/scripts/ptweens.py @@ -28,7 +28,7 @@ class PTweensCommand(object): """ parser = argparse.ArgumentParser( - usage="%(prog)s config_uri", + prog="ptweens", description=textwrap.dedent(description), ) diff --git a/pyramid/scripts/pviews.py b/pyramid/scripts/pviews.py index 81150a801..e93d90a53 100644 --- a/pyramid/scripts/pviews.py +++ b/pyramid/scripts/pviews.py @@ -28,7 +28,7 @@ class PViewsCommand(object): stdout = sys.stdout parser = argparse.ArgumentParser( - usage="%(prog)s config_uri url", + prog="pviews", description=textwrap.dedent(description) ) -- cgit v1.2.3