From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Paul Elder <paul.elder@ideasonboard.com>
Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl
Subject: Re: [PATCH 1/2] v4l2-compliance: Add version command
Date: Fri, 10 Jul 2020 16:25:36 +0300 [thread overview]
Message-ID: <20200710132536.GX5964@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200710131813.452513-1-paul.elder@ideasonboard.com>
Hi Paul,
Thank you for the patch.
On Fri, Jul 10, 2020 at 10:18:12PM +0900, Paul Elder wrote:
> Add a --version option to v4l2-compliance to retrieve the version of
> v4l2-compliance.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
> utils/v4l2-compliance/v4l2-compliance.cpp | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> index 4b45f110..72b9768f 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> @@ -79,6 +79,7 @@ enum Option {
> OptMediaBusInfo = 'z',
> OptStreamFrom = 128,
> OptStreamFromHdr,
> + OptVersion,
> OptLast = 256
> };
>
> @@ -153,9 +154,15 @@ static struct option long_options[] = {
> {"stream-all-formats", optional_argument, 0, OptStreamAllFormats},
> {"stream-all-io", no_argument, 0, OptStreamAllIO},
> {"stream-all-color", required_argument, 0, OptStreamAllColorTest},
> + {"version", no_argument, 0, OptVersion},
> {0, 0, 0, 0}
> };
>
> +static void version()
> +{
> + printf("v4l2-compliance " PACKAGE_VERSION "\n");
Is it enough to rely on the v4l-utils package version, or should we add
a git commit count as well ? The traditional version number will make it
difficult to test for features added between two released versions.
> +}
> +
> static void usage()
> {
> printf("Usage:\n");
> @@ -244,6 +251,7 @@ static void usage()
> printf(" -P, --no-progress Turn off progress messages.\n");
> printf(" -T, --trace Trace all called ioctls.\n");
> printf(" -v, --verbose Turn on verbose reporting.\n");
> + printf(" --version Show version information.\n");
> #ifndef NO_LIBV4L2
> printf(" -w, --wrapper Use the libv4l2 wrapper library.\n");
> #endif
> @@ -1664,6 +1672,9 @@ int main(int argc, char **argv)
> case OptNoProgress:
> no_progress = true;
> break;
> + case OptVersion:
> + version();
> + std::exit(EXIT_SUCCESS);
> case ':':
> fprintf(stderr, "Option `%s' requires a value\n",
> argv[optind]);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-07-10 13:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 13:18 [PATCH 1/2] v4l2-compliance: Add version command Paul Elder
2020-07-10 13:18 ` [PATCH 2/2] v4l2-ctl: " Paul Elder
2020-07-10 13:25 ` Laurent Pinchart [this message]
2020-07-10 13:33 ` [PATCH 1/2] v4l2-compliance: " Hans Verkuil
2020-07-10 13:44 ` paul.elder
2020-07-10 13:50 ` Hans Verkuil
2020-07-10 13:51 ` Laurent Pinchart
2020-07-10 14:03 ` Hans Verkuil
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=20200710132536.GX5964@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=paul.elder@ideasonboard.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