CLI: update subcommands to use return instead of exit() (#10323)
This commit is contained in:
parent
2013f63134
commit
2c9ffd4739
9 changed files with 20 additions and 18 deletions
|
@ -37,7 +37,8 @@ def kle2json(cli):
|
|||
file_path = Path(os.environ['ORIG_CWD'], cli.args.filename)
|
||||
# Check for valid file_path for more graceful failure
|
||||
if not file_path.exists():
|
||||
return cli.log.error('File {fg_cyan}%s{style_reset_all} was not found.', file_path)
|
||||
cli.log.error('File {fg_cyan}%s{style_reset_all} was not found.', file_path)
|
||||
return False
|
||||
out_path = file_path.parent
|
||||
raw_code = file_path.open().read()
|
||||
# Check if info.json exists, allow overwrite with force
|
||||
|
@ -50,8 +51,7 @@ def kle2json(cli):
|
|||
except Exception as e:
|
||||
cli.log.error('Could not parse KLE raw data: %s', raw_code)
|
||||
cli.log.exception(e)
|
||||
# FIXME: This should be better
|
||||
return cli.log.error('Could not parse KLE raw data.')
|
||||
return False
|
||||
keyboard = OrderedDict(
|
||||
keyboard_name=kle.name,
|
||||
url='',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue