summaryrefslogtreecommitdiff
path: root/generate-cmdlist.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2021-11-05 14:08:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-11-05 19:01:13 (GMT)
commit66d55b990ea093be180e816d28143b8952edd52b (patch)
tree619d4cde9577ba508fdc4148525c6df827d1e6ff /generate-cmdlist.sh
parent48bcd823d43f9aab4d843a4b1004137a96677f1f (diff)
downloadgit-66d55b990ea093be180e816d28143b8952edd52b.zip
git-66d55b990ea093be180e816d28143b8952edd52b.tar.gz
git-66d55b990ea093be180e816d28143b8952edd52b.tar.bz2
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>
Diffstat (limited to 'generate-cmdlist.sh')
-rwxr-xr-xgenerate-cmdlist.sh5
1 files changed, 1 insertions, 4 deletions
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index e517c33..a1ab2b1 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -67,10 +67,7 @@ print_command_list () {
while read cmd rest
do
printf " { \"$cmd\", $(get_synopsis $cmd), 0"
- for cat in $(echo "$rest" | get_category_line)
- do
- printf " | CAT_$cat"
- done
+ printf " | CAT_%s" $(echo "$rest" | get_category_line)
echo " },"
done
echo "};"