summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-10-30 23:28:02 -0400
committerGitHub <noreply@github.com>2019-10-30 23:28:02 -0400
commit245dc33730d2a27bc9744be7cf36f176f5a0c10a (patch)
treeba6cfaae945625c28934b38bf537f78a5040b567 /examples
parentb1873c3e6a19276417e7b3a046b48db54a2d6304 (diff)
parent5a58199590f06996cc741063da29ffb166026ced (diff)
downloadcmd2-git-245dc33730d2a27bc9744be7cf36f176f5a0c10a.tar.gz
Merge pull request #796 from python-cmd2/set_prog
Recursively set parser.prog
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/subcommands.py4
-rwxr-xr-xexamples/tab_autocompletion.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/subcommands.py b/examples/subcommands.py
index 0b228e79..4f569b1e 100755
--- a/examples/subcommands.py
+++ b/examples/subcommands.py
@@ -12,7 +12,7 @@ import cmd2
sport_item_strs = ['Bat', 'Basket', 'Basketball', 'Football', 'Space Ball']
# create the top-level parser for the base command
-base_parser = argparse.ArgumentParser(prog='base')
+base_parser = argparse.ArgumentParser()
base_subparsers = base_parser.add_subparsers(title='subcommands', help='subcommand help')
# create the parser for the "foo" subcommand
@@ -38,7 +38,7 @@ sport_arg = parser_sport.add_argument('sport', help='Enter name of a sport', cho
# create the top-level parser for the alternate command
# The alternate command doesn't provide its own help flag
-base2_parser = argparse.ArgumentParser(prog='alternate', add_help=False)
+base2_parser = argparse.ArgumentParser(add_help=False)
base2_subparsers = base2_parser.add_subparsers(title='subcommands', help='subcommand help')
# create the parser for the "foo" subcommand
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py
index 2142fe2e..3561f968 100755
--- a/examples/tab_autocompletion.py
+++ b/examples/tab_autocompletion.py
@@ -204,7 +204,7 @@ class TabCompleteExample(cmd2.Cmd):
'\n '.join(ep_list)))
print()
- video_parser = Cmd2ArgumentParser(prog='media')
+ video_parser = Cmd2ArgumentParser()
video_types_subparsers = video_parser.add_subparsers(title='Media Types', dest='type')