Re: [PATCH v2 2/3] git help: group common commands by theme

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



extract the $grp shell variable from command-list.txt (eg: 'common-3_worktree') and add
this value to the output:

before/after:
{"add", N_("Add file contents to the index")}
{"add", N_("Add file contents to the index"), "3_worktree"}

When 'git help' is called, the displayed commands can be grouped by theme
instead of a less useful alphabetical order.

Signed-off by: Sébastien Guimmara <sebastien.guimmara@xxxxxxxxx>
---
 generate-cmdlist.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 9a4c9b9..98f937b 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -4,19 +4,20 @@ echo "/* Automatically generated by $0 */
 struct cmdname_help {
     char name[16];
     char help[80];
+    char group[20];
 };

 static struct cmdname_help common_cmds[] = {"

-sed -n -e 's/^git-\([^     ]*\)[     ].* common.*/\1/p' command-list.txt |
+sed -n -e 's/^git-\([^ ]*\)[ ].* common-\(.*\)/\1:\2/p' command-list.txt |
 sort |
-while read cmd
+while IFS=: read cmd grp
 do
      sed -n '
      /^NAME/,/git-'"$cmd"'/H
      ${
         x
-        s/.*git-'"$cmd"' - \(.*\)/  {"'"$cmd"'", N_("\1")},/
+        s/.*git-'"$cmd"' - \(.*\)/  {"'"$cmd"'", N_("\1"), "'"$grp"'"},/
         p
      }' "Documentation/git-$cmd.txt"
 done
--
2.4.0
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]