Re: [PATCH v4/wip 02/12] generate-cmds.sh: export all commands to command-list.h
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 25, 2018, 18:07 UTC
- Message-ID
- <CAPig+cQ-ZfvHD6B-mK6tOBMdKiVzwz15M4rsOdBMBcgu0OmuxA@mail.gmail.com>
- In-Reply-To
- <20180425163107.10399-3-pclouds@gmail.com>
On Wed, Apr 25, 2018 at 12:30 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 22 quoted lines
> The current generate-cmds.sh generates just enough to print "git help"
> output. That is, it only extracts help text for common commands.
>
> The script is now updated to extract help text for all commands and
> keep command classification a new file, command-list.h. This will be
> useful later:
> [...]
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
> @@ -12,14 +34,51 @@ get_synopsis () {
> +define_categories() {
> + echo
> + echo "/* Command categories */"
> + bit=0
> + category_list "$1" |
> + while read cat
> + do
> + echo "#define CAT_$cat (1UL << $bit)"
> + bit=$(($bit+1))
> + done
> + test "$bit" -gt 32 && die "Urgh.. too many categories?"Should this be '-ge' rather than '-gt'?
> +}