diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-17 13:48:13 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-17 13:48:13 -0500 |
commit | b034f6d2de92a784853ddeef4e51b26148056691 (patch) | |
tree | 2d692d7e37265164410eaebad44759ab50928192 /examples | |
parent | 91bc999d022a486334b9054859e2ef6f03ca9666 (diff) | |
download | cmd2-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')
-rwxr-xr-x | examples/argparse_example.py | 2 |
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') |