From: Derrick Stolee via GitGitGadget Date: Wed, 23 Feb 2022 18:30:40 GMT Subject: [PATCH 02/25] bundle: alphabetize subcommands better Message-ID: In-Reply-To: From: Derrick Stolee The usage strings for the 'git bundle' subcommands are not alphabetical. This also applies to their inspection within cmd_bundle(). Fix this ordering before we insert a new subcommand. This change does not reorder the cmd_bundle_*() methods to avoid moving lines that are more likely wanted in a future 'git blame' call. It is fine that those longer methods are not ordered alphabetically. Signed-off-by: Derrick Stolee --- builtin/bundle.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/bundle.c b/builtin/bundle.c index 5a85d7cd0fe..8187b7df739 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -13,9 +13,9 @@ static const char * const builtin_bundle_usage[] = { N_("git bundle create [] "), - N_("git bundle verify [] "), N_("git bundle list-heads [...]"), N_("git bundle unbundle [...]"), + N_("git bundle verify [] "), NULL }; @@ -24,11 +24,6 @@ static const char * const builtin_bundle_create_usage[] = { NULL }; -static const char * const builtin_bundle_verify_usage[] = { - N_("git bundle verify [] "), - NULL -}; - static const char * const builtin_bundle_list_heads_usage[] = { N_("git bundle list-heads [...]"), NULL @@ -39,6 +34,11 @@ static const char * const builtin_bundle_unbundle_usage[] = { NULL }; +static const char * const builtin_bundle_verify_usage[] = { + N_("git bundle verify [] "), + NULL +}; + static int parse_options_cmd_bundle(int argc, const char **argv, const char* prefix, @@ -209,12 +209,12 @@ int cmd_bundle(int argc, const char **argv, const char *prefix) else if (!strcmp(argv[0], "create")) result = cmd_bundle_create(argc, argv, prefix); - else if (!strcmp(argv[0], "verify")) - result = cmd_bundle_verify(argc, argv, prefix); else if (!strcmp(argv[0], "list-heads")) result = cmd_bundle_list_heads(argc, argv, prefix); else if (!strcmp(argv[0], "unbundle")) result = cmd_bundle_unbundle(argc, argv, prefix); + else if (!strcmp(argv[0], "verify")) + result = cmd_bundle_verify(argc, argv, prefix); else { error(_("Unknown subcommand: %s"), argv[0]); usage_with_options(builtin_bundle_usage, options); -- gitgitgadget