diff scripts/genconfig.sh @ 653:2986aa63a021

Move commands into "posix", "lsb", and "other" menus/directories.
author Rob Landley <rob@landley.net>
date Sat, 25 Aug 2012 14:25:22 -0500
parents 7b85b0a0e9c0
children f5ef67700a26
line wrap: on
line diff
--- a/scripts/genconfig.sh	Sat Aug 25 14:24:24 2012 -0500
+++ b/scripts/genconfig.sh	Sat Aug 25 14:25:22 2012 -0500
@@ -26,14 +26,25 @@
 
 genconfig()
 {
-  # extract config stanzas from each command source file, in alphabetical order
-
-  for i in $(ls -1 toys/*.c)
+  # I could query the directory here, but I want to control the order
+  # and capitalization in the menu
+  for j in Posix LSB Other
   do
-    # Grab the config block for Config.in
-    echo "# $i"
-    sed -n '/^\*\//q;/^config [A-Z]/,$p' $i || return 1
+    echo "menu \"$j commands\""
     echo
+
+    DIR=$(echo $j | tr A-Z a-z)
+
+    # extract config stanzas from each source file, in alphabetical order
+    for i in $(ls -1 toys/$DIR/*.c)
+    do
+      # Grab the config block for Config.in
+      echo "# $i"
+      sed -n '/^\*\//q;/^config [A-Z]/,$p' $i || return 1
+      echo
+    done
+
+    echo endmenu
   done
 }