running orca with no args should print help instead of throw an error

This commit is contained in:
Reuben Dunnington 2023-09-16 09:59:02 -07:00
parent 00555dc03f
commit 5b7e27f9fd
Signed by: rdunnington
GPG Key ID: 4EC5290E704FD482
1 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,10 @@ attach_version_command(subparsers)
# Using argparse action="version" requires us to pass a single string
# and doesn't allow us to run our own custom version-printing function.
argv = sys.argv[1:]
if argv[0] in ["-v", "--version"]:
if len(argv) == 0:
argv = ["-h"]
elif argv[0] in ["-v", "--version"]:
argv = ["version"]
args = parser.parse_args(argv)