diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-06-16 16:14:14 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-06-17 14:10:24 -0400 |
| commit | ebb939ba0494648a7eb521023649816cd28be6c4 (patch) | |
| tree | da77637440bb65f26bcb05646fcb7396ddf97b8f /cmd2 | |
| parent | 525d32cfde6c2f9fecb0ee44972c18d4b0bf614f (diff) | |
| download | cmd2-git-ebb939ba0494648a7eb521023649816cd28be6c4.tar.gz | |
Updated all examples to use Cmd2ArgumentParser instead of argparse.ArgumentParser.
This is best practice for consistency of appearance between built-in and custom commands.
Diffstat (limited to 'cmd2')
| -rw-r--r-- | cmd2/decorators.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/decorators.py b/cmd2/decorators.py index 2d57a5bf..1ff0bdbe 100644 --- a/cmd2/decorators.py +++ b/cmd2/decorators.py @@ -288,7 +288,7 @@ def with_argparser( :Example: - >>> parser = argparse.ArgumentParser() + >>> parser = cmd2.Cmd2ArgumentParser() >>> parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay') >>> parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE') >>> parser.add_argument('-r', '--repeat', type=int, help='output [n] times') @@ -302,7 +302,7 @@ def with_argparser( :Example with unknown args: - >>> parser = argparse.ArgumentParser() + >>> parser = cmd2.Cmd2ArgumentParser() >>> parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay') >>> parser.add_argument('-s', '--shout', action='store_true', help='N00B EMULATION MODE') >>> parser.add_argument('-r', '--repeat', type=int, help='output [n] times') |
