plinth: Add --version flag to print version and exit

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Drop string "version" from the output]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2025-07-27 08:59:50 -07:00
1 parent bd656386b9
commit 2200a83579
1 file changed
+6
+6
View File
@@ -39,6 +39,8 @@ def parse_arguments():
help='list package dependencies for essential modules')
parser.add_argument('--list-apps', default=False, nargs='*',
help='list apps')
parser.add_argument('--version', action='store_true', default=None,
help='show version and exit')
return parser.parse_args()
@@ -125,6 +127,10 @@ def main():
adapt_config(arguments)
if arguments.version:
print(f'FreedomBox {__version__}')
sys.exit(0)
if arguments.list_dependencies is not False:
log.default_level = 'ERROR'
module_loader.load_modules()