git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Git List <git@vger.kernel.org>, bfields@redhat.com
Subject: Re: [PATCH 1/4] parse-options: convert "command mode" to a flag
Date: Wed, 19 Feb 2020 14:11:24 -0500	[thread overview]
Message-ID: <CAPig+cQkBKJLW3-W4SS0KX9+Gs2fT-Z-DrvVpcVOLZpFmVBoQA@mail.gmail.com> (raw)
In-Reply-To: <20200219161352.13562-2-pbonzini@redhat.com>

On Wed, Feb 19, 2020 at 11:15 AM <pbonzini@redhat.com> wrote:
> OPTION_CMDMODE is essentially OPTION_SET_INT plus the extra check
> that the variable had not set before.  In order to allow custom
> processing, change it to OPTION_SET_INT plus a new flag that takes
> care of the check.  This works as long as the option value points
> to an int.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
> @@ -324,6 +326,22 @@ test_expect_success 'OPT_NEGBIT() works' '
> +test_expect_success 'OPT_CMDMODE() detects incompatibility' '
> +       test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err &&
> +       test_must_be_empty output &&
> +       grep "incompatible with --mode" output.err
> +'

The error message may have been localized, so use test_i18ngrep()
instead of 'grep':

    test_i18ngrep "incompatible with --mode" output.err

> +
> +test_expect_success 'OPT_CMDMODE() detects incompatibility with something else' '
> +       test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err &&
> +       test_must_be_empty output &&
> +       grep "incompatible with something else" output.err
> +'

Ditto.

  reply	other threads:[~2020-02-19 19:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 16:13 [PATCH 0/4] am: provide a replacement for "cat .git/rebase-apply/patch" pbonzini
2020-02-19 16:13 ` [PATCH 1/4] parse-options: convert "command mode" to a flag pbonzini
2020-02-19 19:11   ` Eric Sunshine [this message]
2020-02-20 16:00     ` Johannes Schindelin
2020-02-19 19:15   ` Junio C Hamano
2020-02-19 21:05     ` Paolo Bonzini
2020-02-19 16:13 ` [PATCH 2/4] am: convert "resume" variable to a struct pbonzini
2020-02-19 19:19   ` Junio C Hamano
2020-02-19 21:05     ` Paolo Bonzini
2020-02-19 16:13 ` [PATCH 3/4] am: support --show-current-patch=raw as a synonym for--show-current-patch pbonzini
2020-02-19 19:34   ` Eric Sunshine
2020-02-19 20:17     ` Junio C Hamano
2020-02-19 20:53       ` Paolo Bonzini
2020-02-19 16:13 ` [PATCH 4/4] am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch pbonzini
2020-02-19 19:49   ` Eric Sunshine

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=CAPig+cQkBKJLW3-W4SS0KX9+Gs2fT-Z-DrvVpcVOLZpFmVBoQA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=bfields@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=pbonzini@redhat.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).