[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFd5g4509cBW2_NMatiptB7VjR-Z9Dn83d2f_tZdix2jTzXonw@mail.gmail.com>
Date: Wed, 23 Mar 2022 19:31:48 -0400
From: Brendan Higgins <brendanhiggins@...gle.com>
To: Daniel Latypov <dlatypov@...gle.com>
Cc: davidgow@...gle.com, linux-kernel@...r.kernel.org,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
skhan@...uxfoundation.org
Subject: Re: [PATCH v2] kunit: tool: more descriptive metavars/--help output
On Sat, Feb 26, 2022 at 4:23 PM Daniel Latypov <dlatypov@...gle.com> wrote:
>
> Before, our help output contained lines like
> --kconfig_add KCONFIG_ADD
> --qemu_config qemu_config
> --jobs jobs
>
> They're not very helpful.
>
> The former kind come from the automatic 'metavar' we get from argparse,
> the uppercase version of the flag name.
> The latter are where we manually specified metavar as the flag name.
>
> After:
> --build_dir DIR
> --make_options X=Y
> --kunitconfig PATH
> --kconfig_add CONFIG_X=Y
> --arch ARCH
> --cross_compile PREFIX
> --qemu_config FILE
> --jobs N
> --timeout SECONDS
> --raw_output [{all,kunit}]
> --json [FILE]
>
> This patch tries to make the code more clear by specifying the _type_ of
> input we expect, e.g. --build_dir is a DIR, --qemu_config is a FILE.
> I also switched it to uppercase since it looked more clearly like
> placeholder text that way.
>
> This patch also changes --raw_output to specify `choices` to make it
> more clear what the options are, and this way argparse can validate it
> for us, as shown by the added test case.
>
> Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
> Reviewed-by: David Gow <davidgow@...gle.com>
Reviewed-by: Brendan Higgins <brendanhiggins@...gle.com>
Powered by blists - more mailing lists