git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Hubert Jasudowicz" <hubertj@stmcyber.pl>,
	"Derrick Stolee" <derrickstolee@github.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/2] bundle <cmd>: have usage_msg_opt() note the missing "<file>"
Date: Tue, 27 Dec 2022 19:39:10 +0100	[thread overview]
Message-ID: <patch-2.2-00f74250fd0-20221227T183708Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.2-00000000000-20221227T183708Z-avarab@gmail.com>

Improve the usage we emit on e.g. "git bundle create" to note why
we're showing the usage, it's because the "<file>" argument is
missing.

We know that'll be the case for all parse_options_cmd_bundle() users,
as they're passing the "char **bundle_file" parameter, which as the
context shows we're expected to populate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/bundle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/bundle.c b/builtin/bundle.c
index 3d1ad220ff8..acceef62001 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -58,7 +58,7 @@ static int parse_options_cmd_bundle(int argc,
 	argc = parse_options(argc, argv, NULL, options, usagestr,
 			     PARSE_OPT_STOP_AT_NON_OPTION);
 	if (!argc)
-		usage_with_options(usagestr, options);
+		usage_msg_opt(_("need a <file> argument"), usagestr, options);
 	*bundle_file = prefix_filename(prefix, argv[0]);
 	return argc;
 }
-- 
2.39.0.1106.gf45ba805d1a


  parent reply	other threads:[~2022-12-27 18:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 12:31 [PATCH] Revert "builtin/bundle.c: let parse-options parse subcommands" Hubert Jasudowicz
2022-12-20 13:30 ` Derrick Stolee
2022-12-20 13:42   ` Ævar Arnfjörð Bjarmason
2022-12-20 13:40 ` [PATCH] bundle: don't segfault on "git bundle <subcmd>" Ævar Arnfjörð Bjarmason
2022-12-20 13:50   ` Hubert Jasudowicz
2022-12-25 11:06     ` Junio C Hamano
2022-12-25 11:05   ` Junio C Hamano
2022-12-27 18:39     ` [PATCH 0/2] builtin/bundle.c: segfault fix style & error reporting follow-up Ævar Arnfjörð Bjarmason
2022-12-27 18:39       ` [PATCH 1/2] builtin/bundle.c: remove superfluous "newargc" variable Ævar Arnfjörð Bjarmason
2022-12-27 18:39       ` Ævar Arnfjörð Bjarmason [this message]
2022-12-27 23:32       ` [PATCH 0/2] builtin/bundle.c: segfault fix style & error reporting follow-up Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-2.2-00f74250fd0-20221227T183708Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hubertj@stmcyber.pl \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).