Skip to content

Commit 66d55b9

Browse files
j6tgitster
authored andcommitted
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>
1 parent 48bcd82 commit 66d55b9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

generate-cmdlist.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ print_command_list () {
6767
while read cmd rest
6868
do
6969
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)
7471
echo " },"
7572
done
7673
echo "};"

0 commit comments

Comments
 (0)