Skip to content

Commit 423a2ae

Browse files
committed
[update] : Use an external script in the help display
1 parent 93b3816 commit 423a2ae

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

build.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ getclm() {
104104
echo "$(cat -)" | cut -d " " -f "${1}"
105105
}
106106

107+
# Usage: echo_blank <number>
108+
# 指定されたぶんの半角空白文字を出力します
109+
echo_blank(){
110+
local _blank
111+
for _local in $(seq 1 "${1}"); do echo -ne " "; done
112+
}
107113

108114
_usage () {
109115
echo "usage ${0} [options] [channel]"
@@ -138,26 +144,23 @@ _usage () {
138144
echo " Default: ${work_dir}"
139145
echo
140146

141-
local blank="33" _arch _lang _list _locale_name_list kernel _dirname _channel _b
147+
local blank="33" _arch _list _dirname _channel
142148

143149
echo " Language for each architecture:"
144150
for _list in ${script_path}/system/locale-* ; do
145151
_arch="${_list#${script_path}/system/locale-}"
146152
echo -n " ${_arch}"
147-
for i in $( seq 1 $(( ${blank} - 4 - ${#_arch} )) ); do echo -ne " "; done
148-
_locale_name_list=$(cat ${_list} | grep -h -v ^'#' | getclm 1)
149-
for _lang in ${_locale_name_list[@]};do echo -n "${_lang} "; done
150-
echo
153+
echo_blank "$(( ${blank} - 4 - ${#_arch} ))"
154+
"${script_path}/tools/locale.sh" -a "${_arch}" show
151155
done
152156

153157
echo
154158
echo " Kernel for each architecture:"
155159
for _list in ${script_path}/system/kernel-* ; do
156160
_arch="${_list#${script_path}/system/kernel-}"
157161
echo -n " ${_arch} "
158-
for i in $( seq 1 $(( ${blank} - 5 - ${#_arch} )) ); do echo -ne " "; done
159-
for kernel in $(grep -h -v ^'#' ${_list} | getclm 1); do echo -n "${kernel} "; done
160-
echo
162+
echo_blank "$(( ${blank} - 5 - ${#_arch} ))"
163+
"${script_path}/tools/kernel.sh" -a "${_arch}" show
161164
done
162165

163166
echo
@@ -169,7 +172,7 @@ _usage () {
169172
_channel="${_dirname}"
170173
fi
171174
echo -ne " ${_channel}"
172-
for _b in $( seq 1 $(( ${blank} - 4 - ${#_channel} )) ); do echo -ne " "; done
175+
echo_blank "$(( ${blank} - 4 - ${#_channel} ))"
173176
if [[ ! "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then
174177
"${script_path}/tools/msg.sh" --noadjust -l 'ERROR:' --noappname error "Not compatible with AlterISO3"
175178
elif [[ -f "${script_path}/channels/${_dirname}/description.txt" ]]; then
@@ -179,7 +182,7 @@ _usage () {
179182
fi
180183
done
181184
echo -ne " rebuild"
182-
for i in $( seq 1 $(( ${blank} - 11 )) ); do echo -ne " "; done
185+
echo_blank "$(( ${blank} - 11 ))"
183186
echo -ne "Build from the point where it left off using the previous build settings.\n"
184187

185188
echo

0 commit comments

Comments
 (0)