Thread (70 messages) flat view 70 messages, 8 authors, 2021-11-05
STALE1741d

[PATCH v3 06/10] generate-cmdlist.sh: replace for loop by printf's auto-repeat feature

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-11-05 14:08:26
Subsystem: the rest · Maintainer: Linus Torvalds

From: Johannes Sixt <redacted>

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 <redacted>
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 generate-cmdlist.sh | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index e517c33710a..a1ab2b1f077 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 "};"
-- 
2.34.0.rc1.721.ga0c1db665bc
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help