File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414import cmd2
1515from cmd2 import (
16- Cmd2ArgumentParser ,
1716 CommandSet ,
1817 with_argparser ,
1918 with_category ,
@@ -48,16 +47,16 @@ def do_app_command(self, _: cmd2.Statement) -> None:
4847 """A standard command defined in the child class."""
4948 self .poutput ("Application command executed" )
5049
51- @with_argparser (Cmd2ArgumentParser ( description = "Overridden quit command" ) )
52- def do_quit (self , _ : argparse .Namespace ) -> bool | None :
50+ @with_argparser (cmd2 . Cmd . _build_quit_parser )
51+ def do_quit (self , args : argparse .Namespace ) -> bool | None :
5352 """Overriding a built-in command without a decorator moves it to our category."""
54- return super ().do_quit ("" )
53+ return super ().do_quit (args . cmd2_statement )
5554
5655 @with_category (cmd2 .Cmd .DEFAULT_CATEGORY )
57- @with_argparser (Cmd2ArgumentParser ( description = "Overridden shortcuts command" ) )
58- def do_shortcuts (self , _ : argparse .Namespace ) -> None :
56+ @with_argparser (cmd2 . Cmd . _build_shortcuts_parser )
57+ def do_shortcuts (self , args : argparse .Namespace ) -> None :
5958 """Overriding with @with_category(cmd2.Cmd.DEFAULT_CATEGORY) keeps it cmd2's category."""
60- super ().do_shortcuts ("" )
59+ super ().do_shortcuts (args . cmd2_statement )
6160
6261
6362if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments