summaryrefslogtreecommitdiff
path: root/examples/argparse_example.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-17 13:48:13 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-17 13:48:13 -0500
commitb034f6d2de92a784853ddeef4e51b26148056691 (patch)
tree2d692d7e37265164410eaebad44759ab50928192 /examples/argparse_example.py
parent91bc999d022a486334b9054859e2ef6f03ca9666 (diff)
downloadcmd2-git-b034f6d2de92a784853ddeef4e51b26148056691.tar.gz
Improved how new argparse-based decorators provide help
Now "help command_name" and "command_name -h" provide exactly the same text. The function docstring for the "do_*" command sets and overrides the ArgumentParser "description" if the docstring is not empty.
Diffstat (limited to 'examples/argparse_example.py')
-rwxr-xr-xexamples/argparse_example.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/argparse_example.py b/examples/argparse_example.py
index ae45411c..48adca52 100755
--- a/examples/argparse_example.py
+++ b/examples/argparse_example.py
@@ -64,7 +64,7 @@ class CmdLineApp(Cmd):
do_say = do_speak # now "say" is a synonym for "speak"
do_orate = do_speak # another synonym, but this one takes multi-line input
- tag_parser = argparse.ArgumentParser(description='create a html tag')
+ tag_parser = argparse.ArgumentParser()
tag_parser.add_argument('tag', nargs=1, help='tag')
tag_parser.add_argument('content', nargs='+', help='content to surround with tag')