File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,22 +212,21 @@ def main(argv=None):
212212 )
213213 help .add_argument ('help_cmd' , nargs = '?' , help = 'Command to show help for.' )
214214
215- # Argparse doesn't really provide a way to use a `default` subparser
215+ # argparse doesn't really provide a way to use a `default` subparser
216216 if len (argv ) == 0 :
217217 argv = ['run' ]
218218 args = parser .parse_args (argv )
219- if args .command == 'run' :
219+
220+ if args .command == 'help' and args .help_cmd :
221+ parser .parse_args ([args .help_cmd , '--help' ])
222+ elif args .command == 'help' :
223+ parser .parse_args (['--help' ])
224+ elif args .command in {'run' , 'try-repo' }:
220225 args .files = [
221226 os .path .relpath (os .path .abspath (filename ), git .get_root ())
222227 for filename in args .files
223228 ]
224229
225- if args .command == 'help' :
226- if args .help_cmd :
227- parser .parse_args ([args .help_cmd , '--help' ])
228- else :
229- parser .parse_args (['--help' ])
230-
231230 with error_handler ():
232231 add_logging_handler (args .color )
233232 runner = Runner .create (args .config )
You can’t perform that action at this time.
0 commit comments