From: Johannes Sixt Date: Fri, 5 Nov 2021 14:08:04 +0000 (+0100) Subject: generate-cmdlist.sh: replace for loop by printf's auto-repeat feature X-Git-Tag: v2.35.0-rc0~116^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66d55b990ea093be180e816d28143b8952edd52b;p=thirdparty%2Fgit.git 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 Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index e517c33710..a1ab2b1f07 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 "};"