File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ def add_arguments(self):
383383 method_options .add_argument (
384384 "--set-hardware-usage" ,
385385 action = "store" ,
386- deimport difflibst = "set_hardware_usage" ,
386+ dest = "set_hardware_usage" ,
387387 default = Config .settings .set_hardware_usage ,
388388 help = _ ("set_hardware_usage" ),
389389 )
@@ -529,12 +529,17 @@ def parse_arguments(self):
529529 valid_flags .extend (action .option_strings )
530530
531531 for arg in unknown_args :
532- if arg .startswith ("-" ) and len (arg ) > 1 :
532+ if arg .startswith ("-- " ) and len (arg ) > 1 :
533533 suggestion = difflib .get_close_matches (arg , valid_flags , n = 1 )
534534 if suggestion :
535- print (f"Error: Unknown argument '{ arg } '. Did you mean '{ suggestion [0 ]} '?" )
535+ print (
536+ f"Error: Unknown argument '{ arg } '. Did you mean '{ suggestion [0 ]} '?" ,
537+ file = sys .stderr ,
538+ )
536539 else :
537- print (f"Error: Unknown argument '{ arg } '" )
540+ print (f"Error: Unknown argument '{ arg } '" , file = sys .stderr )
541+ else :
542+ print (f"Error: Unexpected argument '{ arg } '" , file = sys .stderr )
538543
539544 sys .exit (1 )
540545
You can’t perform that action at this time.
0 commit comments