From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com, gjasny@googlemail.com,
hverkuil@xs4all.nl, kieran.bingham@ideasonboard.com,
mchehab@kernel.org, nicolas@ndufresne.ca, p.zabel@pengutronix.de,
rosenp@gmail.com, sean@mess.org, user.vdr@gmail.com,
xavier.claessens@collabora.com, deborah.brouwer@collabora.com,
ariel@vanguardiasur.com.ar, ezequiel@vanguardiasur.com.ar,
tomi.valkeinen@ideasonboard.com
Subject: [PATCH 1/1] utils: Add help text for v4l2-tracer-gen.pl
Date: Tue, 21 Feb 2023 18:08:49 +0200 [thread overview]
Message-ID: <20230221160849.2778-1-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20230221143204.26591-1-laurent.pinchart@ideasonboard.com>
Add help text for v4l2-tracer-gen.pl, via the '-h' option. Also add
support for '--' to signal end of options, in case file names would begin
with dash.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Laurent,
Can you squash this to the utils patch?
- Sakari
utils/v4l2-tracer/v4l2-tracer-gen.pl | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/utils/v4l2-tracer/v4l2-tracer-gen.pl b/utils/v4l2-tracer/v4l2-tracer-gen.pl
index 8192a5bf..53473ae1 100755
--- a/utils/v4l2-tracer/v4l2-tracer-gen.pl
+++ b/utils/v4l2-tracer/v4l2-tracer-gen.pl
@@ -8,8 +8,26 @@ my %outtype = ( "common" => 1, "trace" => 1, "retrace" => 1 );
while ($ARGV[0] =~ /^-/) {
my $arg = shift @ARGV;
- $outdir = shift @ARGV if $arg eq "-o";
- %outtype = (shift @ARGV => 1) if $arg eq '-t';
+ ($outdir = shift @ARGV) && next if $arg eq "-o";
+ (%outtype = (shift @ARGV => 1)) && next if $arg eq '-t';
+ (help() && exit 0) if $arg eq '-h';
+ last if $arg eq '--';
+
+ print stderr "invalid option $arg, use $0 -h for help\n";
+ exit 0;
+}
+
+sub help() {
+ print stderr <<EOF;
+$0 - Generate files for V4L2 tracer
+
+usage: $0 [-o dir] [-t (common|trace|retrace)] [-h] header [header2] ...
+
+ -o dir set output directory
+ -t x generate particular trace files, the default is to generate
+ them all
+ -h print this help text and quit
+EOF
}
sub convert_type_to_json_type {
--
2.30.2
next prev parent reply other threads:[~2023-02-21 16:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 14:31 [v4l-utils] [PATCH v9 0/7] Switch build system to meson Laurent Pinchart
2023-02-21 14:31 ` [v4l-utils] [PATCH v9 1/7] utils: Allow choosing v4l2-tracer-gen.pl output Laurent Pinchart
2023-02-21 15:00 ` Hans Verkuil
2023-02-21 15:04 ` Sakari Ailus
2023-02-21 14:31 ` [v4l-utils] [PATCH v9 2/7] Move README to markdown syntax Laurent Pinchart
2023-02-21 14:32 ` [v4l-utils] [PATCH v9 3/7] Add support for meson building Laurent Pinchart
2023-02-21 14:43 ` Hans Verkuil
2023-02-21 14:51 ` Laurent Pinchart
2023-02-22 10:41 ` Gregor Jasny
2023-02-22 11:12 ` Laurent Pinchart
2023-02-22 17:50 ` Deborah Brouwer
2023-02-22 19:46 ` Hans Verkuil
2023-02-22 19:50 ` Hans Verkuil
2023-02-22 21:12 ` Gregor Jasny
2023-02-22 22:03 ` Hans Verkuil
2023-02-21 14:32 ` [v4l-utils] [PATCH v9 4/7] Copy Doxygen configuration file to doc/ Laurent Pinchart
2023-02-21 14:32 ` [v4l-utils] [PATCH v9 5/7] meson: Add support for doxygen documentation Laurent Pinchart
2023-02-21 14:32 ` [v4l-utils] [PATCH v9 6/7] Drop autoconf/automake support Laurent Pinchart
2023-02-21 14:32 ` [v4l-utils] [PATCH v9 7/7] meson: Use -include to include config.h instead of -I Laurent Pinchart
2023-02-21 14:36 ` [v4l-utils] [PATCH v9 0/7] Switch build system to meson Sakari Ailus
2023-02-21 16:06 ` Sean Young
2023-02-21 16:08 ` Sakari Ailus [this message]
2023-02-21 16:17 ` [PATCH 1/1] utils: Add help text for v4l2-tracer-gen.pl Laurent Pinchart
2023-02-21 16:18 ` Hans Verkuil
2023-02-21 18:45 ` Deborah Brouwer
2023-02-22 7:11 ` Sakari Ailus
2023-02-22 8:42 ` Laurent Pinchart
2023-02-23 7:57 ` [v4l-utils] [PATCH v9 0/7] Switch build system to meson Tomi Valkeinen
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=20230221160849.2778-1-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=ariel@vanguardiasur.com.ar \
--cc=deborah.brouwer@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=gjasny@googlemail.com \
--cc=hverkuil@xs4all.nl \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=p.zabel@pengutronix.de \
--cc=rosenp@gmail.com \
--cc=sean@mess.org \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=user.vdr@gmail.com \
--cc=xavier.claessens@collabora.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