Re: [PATCH/RFC 2/5] git.c: implement --list-cmds=all and use it in git-completion.bash
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 9, 2018, 03:32 UTC
- Message-ID
- <CAPig+cTZsxazyzsm9HGm4upP4RLcyVWG2XH+jFAVoa=N4_093w@mail.gmail.com>
- In-Reply-To
- <20180326165520.802-3-pclouds@gmail.com>
On Mon, Mar 26, 2018 at 12:55 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 17 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/help.c b/help.c
> @@ -228,6 +228,21 @@ void list_common_cmds_help(void)
> +void list_all_cmds(void)
> +{
> + struct cmdnames main_cmds, other_cmds;
> + int i;
> +
> + memset(&main_cmds, 0, sizeof(main_cmds));
> + memset(&other_cmds, 0, sizeof(other_cmds));
> + load_command_list("git-", &main_cmds, &other_cmds);
> +
> + for (i = 0; i < main_cmds.cnt; i++)
> + puts(main_cmds.names[i]->name);
> + for (i = 0; i < other_cmds.cnt; i++)
> + puts(other_cmds.names[i]->name);clean_cmdnames(&main_cmds); clean_cmdnames(&other_cmds);
> +}