diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-21 19:38:51 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-23 21:41:37 (GMT) |
commit | 1ce590133b545aa735683f46003d12df624d67af (patch) | |
tree | cc0a4a943280fe23bf58b5914b474a9048b17663 /help.c | |
parent | 503cddacb63b9a37d063de5b11ac188de822e06f (diff) | |
download | git-1ce590133b545aa735683f46003d12df624d67af.zip git-1ce590133b545aa735683f46003d12df624d67af.tar.gz git-1ce590133b545aa735683f46003d12df624d67af.tar.bz2 |
help: add --no-[external-commands|aliases] for use with --all
Add the ability to only emit git's own usage information under
--all. This also allows us to extend the "test_section_spacing" tests
added in a preceding commit to test "git help --all"
output.
Previously we could not do that, as the tests might find a git-*
command in the "$PATH", which would make the output differ from one
setup to another.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r-- | help.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -476,15 +476,17 @@ static void list_all_cmds_help_aliases(int longest) string_list_clear(&alias_list, 1); } -void list_all_cmds_help(void) +void list_all_cmds_help(int show_external_commands, int show_aliases) { int longest; puts(_("See 'git help <command>' to read about a specific subcommand")); print_cmd_by_category(main_categories, &longest); - list_all_cmds_help_external_commands(); - list_all_cmds_help_aliases(longest); + if (show_external_commands) + list_all_cmds_help_external_commands(); + if (show_aliases) + list_all_cmds_help_aliases(longest); } int is_in_cmdlist(struct cmdnames *c, const char *s) |