1
0
Fork 0

CLI: update subcommands to use return instead of exit() (#10323)

This commit is contained in:
Ryan 2020-10-07 10:46:10 +11:00 committed by GitHub
parent 2013f63134
commit 2c9ffd4739
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 18 deletions

View file

@ -22,12 +22,12 @@ def json2c(cli):
# TODO(skullydazed/anyone): Read file contents from STDIN
cli.log.error('Reading from STDIN is not (yet) supported.')
cli.print_usage()
exit(1)
return False
if not cli.args.filename.exists():
cli.log.error('JSON file does not exist!')
cli.print_usage()
exit(1)
return False
# Environment processing
if cli.args.output and cli.args.output.name == '-':