From 5b7cee454bb523f7227da1f9fef06ed6beb16861 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 5 Jun 2023 23:32:04 +0200 Subject: [PATCH] Continued: - exit with returned status code --- fba.py | 5 ++++- fba/boot.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 ...") -- 2.39.5