From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?U8OpYmFzdGllbiBHdWltbWFyYQ==?= Subject: [PATCH v2 2/3] git help: group common commands by theme Date: Sat, 02 May 2015 01:06:36 +0200 Message-ID: <554406FC.8010309@gmail.com> References: <554405D5.9080702@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sat May 02 01:06:52 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoK1C-0004dk-Cq for gcvg-git-2@plane.gmane.org; Sat, 02 May 2015 01:06:50 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750785AbbEAXGk convert rfc822-to-quoted-printable (ORCPT ); Fri, 1 May 2015 19:06:40 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:35991 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbbEAXGj (ORCPT ); Fri, 1 May 2015 19:06:39 -0400 Received: by wgen6 with SMTP id n6so102240621wge.3 for ; Fri, 01 May 2015 16:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=pQvVdHDKLxzrkIbdAgqiHAS2qnI9dL4x5BpB5edNuVg=; b=pkaUPKDioyR+0pMnDBlnzrWqutQ9s3JXttPmufNXjSeIg9zsYpLVB6HlQjk3PflCTv Ri8fBXMlSdJs51E/8vpKSZOzxy23zT5BGJCBFUQp9rS97Vv6hLJXZVEDR3c2RjnXAolq nUP0le1QE7ueVlwj2LPnaqdNKr99EnUcFp8OskdJNGWK8CvnGe/78i0/QFnjMMhI4Mw1 VjxE6FRmaTJhXto36FaoBfZVO8z7sQfoWnie41f6ZHN/N4utbPqAo78h45oeyp+t+p7b MCHW/r8+2fTPw4pIsAE3nqXoJfjoiGCjUfDY/C/JRnyelT9UfVvPNL2gymwOqlucuu+T jJYQ== X-Received: by 10.180.83.130 with SMTP id q2mr524813wiy.89.1430521598394; Fri, 01 May 2015 16:06:38 -0700 (PDT) Received: from [192.168.0.10] (bd231-1-88-176-208-17.fbx.proxad.net. [88.176.208.17]) by mx.google.com with ESMTPSA id n8sm8505802wiy.19.2015.05.01.16.06.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 May 2015 16:06:37 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <554405D5.9080702@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Extract the $grp shell variable from command-list.txt (eg:=20 '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"} So that when 'git' is called, we can display common commands grouped by theme instead of a less useful alphabetical order. Signed-off by S=C3=A9bastien Guimmara --- generate-cmdlist.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 9a4c9b9..818b2f3 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -4,19 +4,22 @@ echo "/* Automatically generated by $0 */ struct cmdname_help { char name[16]; char help[80]; + char group[20]; }; static struct cmdname_help common_cmds[] =3D {" -sed -n -e 's/^git-\([^ ]*\)[ ].* common.*/\1/p' command-list.t= xt | +sed -n -e 's/^git-\([^ ]*\)[ ].* common-\(.*\)/\1:\2/p'=20 command-list.txt | sort | -while read cmd +while read line do + cmd=3D`echo $line | cut -d ':' -f 1` + grp=3D`echo $line | cut -d ':' -f 2` 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 --=20 2.4.0