@@ -176,7 +176,7 @@ def cat_decorator(func):
176176
177177
178178def with_argument_list (func : Callable [[Statement ], Optional [bool ]],
179- preserve_quotes : bool = False ) -> Callable [[List ], Optional [bool ]]:
179+ preserve_quotes : bool = False ) -> Callable [[List ], Optional [bool ]]:
180180 """A decorator to alter the arguments passed to a do_* cmd2 method. Default passes a string of whatever the user
181181 typed. With this decorator, the decorated method will receive a list of arguments parsed from user input using
182182 shlex.split().
@@ -196,7 +196,7 @@ def cmd_wrapper(self, cmdline):
196196 return cmd_wrapper
197197
198198
199- def with_argparser_and_unknown_args (argparser : argparse .ArgumentParser , preserve_quotes : bool = False ) -> \
199+ def with_argparser_and_unknown_args (argparser : argparse .ArgumentParser , preserve_quotes : bool = False ) -> \
200200 Callable [[argparse .Namespace , List ], Optional [bool ]]:
201201 """A decorator to alter a cmd2 method to populate its ``args`` argument by parsing arguments with the given
202202 instance of argparse.ArgumentParser, but also returning unknown args as a list.
@@ -239,7 +239,7 @@ def cmd_wrapper(instance, cmdline):
239239
240240
241241def with_argparser (argparser : argparse .ArgumentParser ,
242- preserve_quotes : bool = False ) -> Callable [[argparse .Namespace ], Optional [bool ]]:
242+ preserve_quotes : bool = False ) -> Callable [[argparse .Namespace ], Optional [bool ]]:
243243 """A decorator to alter a cmd2 method to populate its ``args`` argument by parsing arguments
244244 with the given instance of argparse.ArgumentParser.
245245
@@ -365,9 +365,9 @@ class Cmd(cmd.Cmd):
365365 'quiet' : "Don't print nonessential feedback" ,
366366 'timing' : 'Report execution times' }
367367
368- def __init__ (self , completekey : str = 'tab' , stdin = None , stdout = None , persistent_history_file : str = '' ,
369- persistent_history_length : int = 1000 , startup_script : Optional [str ]= None , use_ipython : bool = False ,
370- transcript_files : Optional [List [str ]]= None ) -> None :
368+ def __init__ (self , completekey : str = 'tab' , stdin = None , stdout = None , persistent_history_file : str = '' ,
369+ persistent_history_length : int = 1000 , startup_script : Optional [str ] = None , use_ipython : bool = False ,
370+ transcript_files : Optional [List [str ]] = None ) -> None :
371371 """An easy but powerful framework for writing line-oriented command interpreters, extends Python's cmd package.
372372
373373 :param completekey: (optional) readline name of a completion key, default to Tab
@@ -585,7 +585,7 @@ def decolorized_write(self, fileobj: IO, msg: str) -> None:
585585 msg = utils .strip_ansi (msg )
586586 fileobj .write (msg )
587587
588- def poutput (self , msg : Any , end : str = '\n ' , color : str = '' ) -> None :
588+ def poutput (self , msg : Any , end : str = '\n ' , color : str = '' ) -> None :
589589 """Smarter self.stdout.write(); color aware and adds newline of not present.
590590
591591 Also handles BrokenPipeError exceptions for when a commands's output has
@@ -613,8 +613,8 @@ def poutput(self, msg: Any, end: str='\n', color: str='') -> None:
613613 if self .broken_pipe_warning :
614614 sys .stderr .write (self .broken_pipe_warning )
615615
616- def perror (self , err : Union [str , Exception ], traceback_war : bool = True , err_color : str = Fore .LIGHTRED_EX ,
617- war_color : str = Fore .LIGHTYELLOW_EX ) -> None :
616+ def perror (self , err : Union [str , Exception ], traceback_war : bool = True , err_color : str = Fore .LIGHTRED_EX ,
617+ war_color : str = Fore .LIGHTYELLOW_EX ) -> None :
618618 """ Print error message to sys.stderr and if debug is true, print an exception Traceback if one exists.
619619
620620 :param err: an Exception or error message to print out
@@ -647,7 +647,7 @@ def pfeedback(self, msg: str) -> None:
647647 else :
648648 self .decolorized_write (sys .stderr , "{}\n " .format (msg ))
649649
650- def ppaged (self , msg : str , end : str = '\n ' , chop : bool = False ) -> None :
650+ def ppaged (self , msg : str , end : str = '\n ' , chop : bool = False ) -> None :
651651 """Print output using a pager if it would go off screen and stdout isn't currently being redirected.
652652
653653 Never uses a pager inside of a script (Python or text) or when output is being redirected or piped or when
@@ -929,7 +929,7 @@ def delimiter_complete(self, text: str, line: str, begidx: int, endidx: int, mat
929929
930930 def flag_based_complete (self , text : str , line : str , begidx : int , endidx : int ,
931931 flag_dict : Dict [str , Union [Iterable , Callable ]],
932- all_else : Union [None , Iterable , Callable ]= None ) -> List [str ]:
932+ all_else : Union [None , Iterable , Callable ] = None ) -> List [str ]:
933933 """
934934 Tab completes based on a particular flag preceding the token being completed
935935 :param text: the string prefix we are attempting to match (all returned matches must begin with it)
@@ -1184,7 +1184,7 @@ def get_exes_in_path(starts_with: str) -> List[str]:
11841184 return list (exes_set )
11851185
11861186 def shell_cmd_complete (self , text : str , line : str , begidx : int , endidx : int ,
1187- complete_blank : bool = False ) -> List [str ]:
1187+ complete_blank : bool = False ) -> List [str ]:
11881188 """Performs completion of executables either in a user's path or a given path
11891189 :param text: the string prefix we are attempting to match (all returned matches must begin with it)
11901190 :param line: the current input line with leading whitespace removed
@@ -2610,7 +2610,7 @@ def do_help(self, args: argparse.Namespace) -> None:
26102610 # No special behavior needed, delegate to cmd base class do_help()
26112611 super ().do_help (args .command )
26122612
2613- def _help_menu (self , verbose : bool = False ) -> None :
2613+ def _help_menu (self , verbose : bool = False ) -> None :
26142614 """Show a list of commands which help can be displayed for.
26152615 """
26162616 # Get a sorted list of help topics
@@ -2753,7 +2753,8 @@ def do_quit(self, _: argparse.Namespace) -> bool:
27532753 self ._should_quit = True
27542754 return self ._STOP_AND_EXIT
27552755
2756- def select (self , opts : Union [str , List [str ], List [Tuple [Any , Optional [str ]]]], prompt : str = 'Your choice? ' ) -> str :
2756+ def select (self , opts : Union [str , List [str ], List [Tuple [Any , Optional [str ]]]],
2757+ prompt : str = 'Your choice? ' ) -> str :
27572758 """Presents a numbered menu to the user. Modeled after
27582759 the bash shell's SELECT. Returns the item chosen.
27592760
@@ -2809,7 +2810,7 @@ def cmdenvironment(self) -> str:
28092810 Output redirection and pipes allowed: {}"""
28102811 return read_only_settings .format (str (self .terminators ), self .allow_cli_args , self .allow_redirection )
28112812
2812- def show (self , args : argparse .Namespace , parameter : str = '' ) -> None :
2813+ def show (self , args : argparse .Namespace , parameter : str = '' ) -> None :
28132814 """Shows current settings of parameters.
28142815
28152816 :param args: argparse parsed arguments from the set command
@@ -3608,7 +3609,7 @@ def set_window_title(self, title: str) -> None: # pragma: no cover
36083609 else :
36093610 raise RuntimeError ("another thread holds terminal_lock" )
36103611
3611- def cmdloop (self , intro : Optional [str ]= None ) -> None :
3612+ def cmdloop (self , intro : Optional [str ] = None ) -> None :
36123613 """This is an outer wrapper around _cmdloop() which deals with extra features provided by cmd2.
36133614
36143615 _cmdloop() provides the main loop equivalent to cmd.cmdloop(). This is a wrapper around that which deals with
@@ -3863,7 +3864,7 @@ def append(self, new: str) -> None:
38633864 list .append (self , new )
38643865 new .idx = len (self )
38653866
3866- def get (self , getme : Optional [Union [int , str ]]= None ) -> List [HistoryItem ]:
3867+ def get (self , getme : Optional [Union [int , str ]] = None ) -> List [HistoryItem ]:
38673868 """Get an item or items from the History list using 1-based indexing.
38683869
38693870 :param getme: optional item(s) to get (either an integer index or string to search for)
0 commit comments