From: Roland Häder Date: Mon, 5 Jun 2023 21:32:04 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5b7cee454bb523f7227da1f9fef06ed6beb16861;p=fba.git Continued: - exit with returned status code --- diff --git a/fba.py b/fba.py index d7d40c7..ae06813 100755 --- a/fba.py +++ b/fba.py @@ -24,7 +24,10 @@ from fba import * boot.init_parser() # Run command -boot.run_command() +status = boot.run_command() # Shutdown again boot.shutdown() + +# Exit with status code +sys.exit(status) diff --git a/fba/boot.py b/fba/boot.py index db3bb11..1a89741 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -113,8 +113,9 @@ def run_command(): # DEBUG: print("DEBUG: run_command(): CALLED!") args = _PARSER.parse_args() print(f"DEBUG: args[{type(args)}]={args}") - args.command(args) - # DEBUG: print("DEBUG: run_command(): EXIT!") + status = int(args.command(args)) + # DEBUG: print("DEBUG: status={status} - EXIT!") + return status def shutdown(): print("DEBUG: Closing database connection ...")