diff options
Diffstat (limited to 'examples/modular_commands_main.py')
-rw-r--r-- | examples/modular_commands_main.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/examples/modular_commands_main.py b/examples/modular_commands_main.py index fc0be7b0..3aeb8b2a 100644 --- a/examples/modular_commands_main.py +++ b/examples/modular_commands_main.py @@ -11,20 +11,21 @@ from typing import ( Optional, ) -from cmd2 import ( - Cmd, - Cmd2ArgumentParser, - CommandSet, - with_argparser, -) from modular_commands.commandset_basic import ( # noqa: F401 BasicCompletionCommandSet, ) from modular_commands.commandset_complex import ( # noqa: F401 CommandSetA, ) -from modular_commands.commandset_custominit import ( - CustomInitCommandSet, # noqa: F401 +from modular_commands.commandset_custominit import ( # noqa: F401 + CustomInitCommandSet, +) + +from cmd2 import ( + Cmd, + Cmd2ArgumentParser, + CommandSet, + with_argparser, ) @@ -44,16 +45,17 @@ class WithCommandSets(Cmd): # Tab complete from a list using argparse choices. Set metavar if you don't # want the entire choices list showing in the usage text for this command. - example_parser.add_argument('--choices', choices=['some', 'choices', 'here'], metavar="CHOICE", - help="tab complete using choices") + example_parser.add_argument( + '--choices', choices=['some', 'choices', 'here'], metavar="CHOICE", help="tab complete using choices" + ) # Tab complete from choices provided by a choices provider - example_parser.add_argument('--choices_provider', choices_provider=choices_provider, - help="tab complete using a choices_provider") + example_parser.add_argument( + '--choices_provider', choices_provider=choices_provider, help="tab complete using a choices_provider" + ) # Tab complete using a completer - example_parser.add_argument('--completer', completer=Cmd.path_complete, - help="tab complete using a completer") + example_parser.add_argument('--completer', completer=Cmd.path_complete, help="tab complete using a completer") @with_argparser(example_parser) def do_example(self, _: argparse.Namespace) -> None: |