summaryrefslogtreecommitdiff
path: root/apps/installer
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2025-09-04 11:47:44 +0200
committerGitHub <noreply@github.com>2025-09-04 11:47:44 +0200
commitc9e1782d7a902b24439e2d55f4ae9ccf0c7c82af (patch)
tree76fb6247d61ce7ccabc9788f14dfe59748c3acd2 /apps/installer
parent300ed47bc48123067cde95b3456dff3accc72b45 (diff)
Refactor menu command handling for direct execution (#22791)
Diffstat (limited to 'apps/installer')
-rw-r--r--apps/installer/includes/modules-manager/modules.sh11
-rw-r--r--apps/installer/main.sh2
2 files changed, 10 insertions, 3 deletions
diff --git a/apps/installer/includes/modules-manager/modules.sh b/apps/installer/includes/modules-manager/modules.sh
index 7612329649..88cadf01e2 100644
--- a/apps/installer/includes/modules-manager/modules.sh
+++ b/apps/installer/includes/modules-manager/modules.sh
@@ -25,6 +25,7 @@
CURRENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd )
source "$CURRENT_PATH/../../../bash_shared/includes.sh"
+source "$CURRENT_PATH/../includes.sh"
source "$AC_PATH_APPS/bash_shared/menu_system.sh"
# Module management menu definition
@@ -65,7 +66,7 @@ function handle_module_command() {
;;
"quit")
echo "Exiting module manager..."
- exit 0
+ return 0
;;
*)
echo "Invalid option. Use 'help' to see available commands."
@@ -129,7 +130,7 @@ function inst_module_list() {
function inst_module() {
# If no arguments provided, start interactive menu
if [[ $# -eq 0 ]]; then
- menu_run "MODULE MANAGER" handle_module_command "${module_menu_items[@]}"
+ menu_run_with_items "MODULE MANAGER" handle_module_command -- "${module_menu_items[@]}" --
return $?
fi
@@ -727,6 +728,12 @@ function inst_module_install {
# Update one or more modules
function inst_module_update {
+ # Handle help request
+ if [[ "$1" == "--help" || "$1" == "-h" ]]; then
+ inst_module_help
+ return 0
+ fi
+
# Support multiple modules and the --all flag; prompt if none specified.
local args=("$@")
local use_all=false
diff --git a/apps/installer/main.sh b/apps/installer/main.sh
index 3bdd99b225..b1cba33e8a 100644
--- a/apps/installer/main.sh
+++ b/apps/installer/main.sh
@@ -104,4 +104,4 @@ function handle_menu_command() {
}
# Run the menu system
-menu_run "ACORE DASHBOARD" handle_menu_command "${menu_items[@]}" "$@"
+menu_run_with_items "ACORE DASHBOARD" handle_menu_command -- "${menu_items[@]}" -- "$@"