generate-cmdlist.sh: replace for loop by printf's auto-repeat feature
This is just a small code reduction. There is a small probability that the new code breaks when the category list is empty. But that would be noticed during the compile step. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Nov 5, 2021 at 15:08 UTC
66d55b990ea093be180e816d28143b8952edd52b
1 file changed
+1
-4
generate-cmdlist.sh
+1
-4
@@ -67,10 +67,7 @@ print_command_list () {
67
while read cmd rest
68
do
69
printf " { \"$cmd\", $(get_synopsis $cmd), 0"
70
- for cat in $(echo "$rest" | get_category_line)
71
- do
72
- printf " | CAT_$cat"
73
- done
70
+ printf " | CAT_%s" $(echo "$rest" | get_category_line)
71
echo " },"
72
done
73
echo "};"