Skip to content

Commit 3cc05d0

Browse files
committed
part fix conflict
1 parent 3325367 commit 3cc05d0

File tree

1 file changed

+78
-93
lines changed

1 file changed

+78
-93
lines changed

bin/armbian-config

Lines changed: 78 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ echo "Loaded Runtime conditions..." true
7373
clear
7474

7575
case "$1" in
76-
"--help")
77-
if [[ -n "$2" ]]; then
78-
see_cmd_list "$2"
79-
echo ""
80-
exit 0
81-
fi
82-
83-
echo "Usage: armbian-config --[option]
76+
"--help")
77+
if [[ -n "$2" ]]; then
78+
see_cmd_list "$2"
79+
echo ""
80+
else
81+
echo "Usage: armbian-config --[option]
8482
Options:
8583
--help [category] Use [category] to filter specific menu options.
8684
--cmd [option] Run a command from the menu (simple)
@@ -92,93 +90,80 @@ case "$1" in
9290
armbian-config --cmd help
9391
armbian-config --api help
9492
"
95-
exit 0
93+
fi
94+
;;
95+
96+
"--doc")
97+
generate_readme
98+
;;
99+
100+
"--cmd")
101+
INPUTMODE="cmd"
102+
case "$2" in
103+
""|"help")
104+
see_cmd_list
105+
;;
106+
*)
107+
cmd=$(sanitize "$2") || die
108+
execute_command "$cmd"
109+
;;
110+
esac
111+
;;
112+
113+
"--api")
114+
case "$2" in
115+
""|"help")
116+
see_use
117+
;;
118+
*)
119+
fn=$(sanitize "$2") || die
120+
shift 2
121+
"$fn" "$@"
122+
;;
123+
esac
96124
;;
97-
"--doc")
98-
generate_readme
99-
exit 0
100-
;;
101-
"--cmd")
102-
shift
103-
if [[ -z "$1" || "$1" == "help" ]]; then
104-
see_cmd_list
105-
exit 0
106-
fi
107-
108-
args=$(sanitize_input "$@")
109-
execute_command "$args"
110-
exit 0
111-
;;
112-
"--api")
113-
shift
114-
if [[ -z "$1" || "$1" == "help" ]]; then
115-
see_use
116-
exit 0
117-
fi
118-
option="$1"
119-
shift
120-
121-
# echo -e "\"$option\" \"$args\""
122-
"$option" "$@"
123-
exit 0
124-
;;
125-
"main=help" | "main=Help")
126-
see_cli_legacy
127-
echo ""
128-
exit 0
129-
;;
130-
"main="*)
131-
declare -A main_map
132-
main_map=(
133-
# map name to menu category
134-
["System"]="S"
135-
["Software"]="I"
136-
["Network"]="N"
137-
["Localisation"]="L"
138-
)
139-
main_value="${1#main=}"
140-
main_value="${main_map[$main_value]}"
141-
142-
if [ -z "$main_value" ]; then
143-
echo "Error: Invalid List $1"
144-
exit 1
145-
fi
146-
declare -A select_map
147-
# map name to menu number
148-
select_map=(
149-
["Headers"]="04"
150-
["Headers_install"]="04"
151-
["Headers_remove"]="05"
152-
["Firmware"]="06"
153-
["Nightly"]="07"
154-
)
155-
select_value="${2#selection=}"
156-
select_value="${select_map[$select_value]}"
157-
if [ -z "$select_value" ]; then
158-
echo "Error: Invalid Option $2"
159-
exit 1
160-
fi
161-
echo "$main_value""$select_value"
162-
execute_command "$main_value""$select_value"
163-
exit 0
164-
;;
165-
*)
166-
#
167-
# Generate the top menu with the modified Object data
168-
set_colors 4
169-
generate_top_menu "$json_data"
170-
171-
#
172-
# Exit the script with a success status code
173-
174-
#
175-
# Show about this tool on exit
176-
about_armbian_configng
177-
;;
178-
esac
179-
180125

126+
"main=help" | "main=Help")
127+
see_cli_legacy
128+
echo ""
129+
;;
181130

131+
"main="*)
132+
declare -A main_map
133+
main_map=(
134+
# map name to menu category
135+
["System"]="S"
136+
["Software"]="I"
137+
["Network"]="N"
138+
["Localisation"]="L"
139+
)
140+
main_value="${1#main=}"
141+
main_value="${main_map[$main_value]}"
142+
[ -z "$main_value" ] && die "Error: Invalid List $1"
143+
144+
declare -A select_map
145+
# map name to menu number
146+
select_map=(
147+
["Headers"]="04"
148+
["Headers_install"]="04"
149+
["Headers_remove"]="05"
150+
["Firmware"]="06"
151+
["Nightly"]="07"
152+
)
153+
select_value="${2#selection=}"
154+
select_value="${select_map[$select_value]}"
155+
[ -z "$select_value" ] && die "Error: Invalid Option $2"
156+
157+
echo "$main_value""$select_value"
158+
execute_command "$main_value""$select_value"
159+
;;
182160

183-
exit 0
161+
*)
162+
# Generate the top menu with the modified Object data
163+
set_colors 4
164+
generate_top_menu "$json_data"
184165

166+
# Show about this tool on exit
167+
about_armbian_configng
168+
;;
169+
esac

0 commit comments

Comments
 (0)