git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Roger Solano <sroger.git@gmail.com>
Cc: git@vger.kernel.org, Roger Solano <sc_rogeralberto@hotmail.com>
Subject: Re: [GSoC] parse: not show usage help when invalid id
Date: Fri, 16 Mar 2018 16:05:04 -0700	[thread overview]
Message-ID: <xmqq605vzknz.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180316223345.7799-1-sc_rogeralberto@hotmail.com> (Roger Solano's message of "Fri, 16 Mar 2018 18:33:45 -0400")

Roger Solano <sroger.git@gmail.com> writes:

> patch for too chatty command when <id> is invalid
> ex. git tag --contains <id>
>
> It is possible to skip 'goto show_usage_error' when
> parse_long_opt fails? and return directly from there.

Can you explain how this relates to and/or compares with a recent
update [1]?

Thanks.

[1] https://public-inbox.org/git/20180306193116.23876-1-ungureanupaulsebastian@gmail.com

>
> Signed-off-by: Roger Solano <sc_rogeralberto@hotmail.com>
> ---
>  parse-options.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/parse-options.c b/parse-options.c
> index 125e84f98..074915eb3 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -550,7 +550,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
>  			goto show_usage;
>  		switch (parse_long_opt(ctx, arg + 2, options)) {
>  		case -1:
> -			goto show_usage_error;
> +			return -1; 
>  		case -2:
>  			goto unknown;
>  		}

      reply	other threads:[~2018-03-16 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 22:33 [GSoC] parse: not show usage help when invalid id Roger Solano
2018-03-16 23:05 ` Junio C Hamano [this message]

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

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

  git send-email \
    --in-reply-to=xmqq605vzknz.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sc_rogeralberto@hotmail.com \
    --cc=sroger.git@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.
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 NNTP newsgroup(s).