From 9b78cf4913202995dcf065ecf5077bf16fa01f95 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 24 Apr 2020 21:15:34 -0400 Subject: Added info on semantic versioning and branching strategy to CONTRIBUTING.md Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes --- examples/override_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples/override_parser.py') diff --git a/examples/override_parser.py b/examples/override_parser.py index eecb0e88..b6548388 100755 --- a/examples/override_parser.py +++ b/examples/override_parser.py @@ -10,12 +10,14 @@ The following code shows how to override it with your own parser class. # See the code for custom_parser.py. It simply defines a parser and calls cmd2.set_default_argument_parser() # with the custom parser's type. import argparse -argparse.cmd2_parser_module = 'examples.custom_parser' # Next import stuff from cmd2. It will import your module just before the cmd2.Cmd class file is imported # and therefore override the parser class it uses on its commands. from cmd2 import cmd2 +argparse.cmd2_parser_module = 'examples.custom_parser' + + if __name__ == '__main__': import sys app = cmd2.Cmd(use_ipython=True, persistent_history_file='cmd2_history.dat') -- cgit v1.2.1