@@ -35,15 +35,15 @@ def load(cli):
3535
3636 # Assign help tips from cli.msgs
3737 for ctrl_key , ctrl in vars (controls ).items ():
38- if ctrl_key .startswith ('legacy ' ) : continue
38+ if ctrl_key .startswith ('legacy_ ' ) : continue
3939 if not hasattr (ctrl , 'help' ) : ctrl .help = getattr (cli .msgs , f'help_{ ctrl_key .upper ()} ' )
4040
4141 # Parse CLI args
4242 argp = argparse .ArgumentParser (description = cli .description , add_help = False )
4343 for ctrl_key , ctrl in vars (controls ).items (): # add args to argp
4444 kwargs = ctrl .__dict__ .copy ()
4545 args = kwargs .pop ('args' )
46- if ctrl_key .startswith ('legacy ' ):
46+ if ctrl_key .startswith ('legacy_ ' ):
4747 for arg in args :
4848 if arg in sys .argv :
4949 log .warn (f'{ cli .msgs .warn_OPTION } { arg } { cli .msgs .warn_NO_LONGER_HAS_ANY_EFFECT } .' )
@@ -55,7 +55,7 @@ def load(cli):
5555 parsed_args , unknown_args = argp .parse_known_args ()
5656 exempt_flags = [] # exempt dashless + legacy args from validation
5757 for ctrl_key , ctrl in vars (controls ).items ():
58- if getattr (ctrl , 'subcmd' , False ) or ctrl_key .startswith ('legacy ' ):
58+ if getattr (ctrl , 'subcmd' , False ) or ctrl_key .startswith ('legacy_ ' ):
5959 for arg in ctrl .args : exempt_flags .append (arg )
6060 if unknown_args and not all (any (arg .startswith (exempt ) for exempt in exempt_flags ) for arg in unknown_args ):
6161 log .cmd_docs_url_exit (cli , f"{ cli .msgs .err_UNRECOGNIZED_ARGS } : { ' ' .join (unknown_args )} " , cmd = 'help' )
0 commit comments