Handle running repod-file without a command more nicely
Currently when running repod-file
, without a (sub)command, a Invalid subcommand provided!
exception is returned:
$ repod-file
Traceback (most recent call last):
File "/usr/bin/repod-file", line 8, in <module>
sys.exit(repod_file())
File "/usr/lib/python3.10/site-packages/repod/cli/cli.py", line 197, in repod_file
raise RuntimeError("Invalid subcommand provided!")
RuntimeError: Invalid subcommand provided!
$ repod-file package
Traceback (most recent call last):
File "/usr/bin/repod-file", line 8, in <module>
sys.exit(repod_file())
File "/usr/lib/python3.10/site-packages/repod/cli/cli.py", line 189, in repod_file
repod_file_package(args=args)
File "/usr/lib/python3.10/site-packages/repod/cli/cli.py", line 69, in repod_file_package
raise RuntimeError(f"Invalid subcommand {args.package} provided to the 'package' command!")
RuntimeError: Invalid subcommand None provided to the 'package' command!
Providing a non-existent command a error is returned but no exception:
$ repod-file foobar
usage: repod-file [-h] [-d] [-v] {package,management,syncdb,schema} ...
repod-file: error: argument subcommand: invalid choice: 'foobar' (choose from 'package', 'management', 'syncdb', 'schema')
The latter should also be the case when running repod-file
without a (sub)command IMO.