diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-31 05:41:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-09 08:20:06 -0400 |
commit | bcec7c218d5aeb170d18c49a33f9bd36ddf9ee37 (patch) | |
tree | a70446ffac9c3335e807a184a45bba2688716256 | |
parent | c92bab5e1ef4e709001cec678fc7c8f9817a4b2e (diff) |
[media] docs-rst: parse-headers.pl: make debug a command line option
Add a parser for the --debug option, in order to allow
seeing what the parser is doing.
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rwxr-xr-x | Documentation/sphinx/parse-headers.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl index 74089b0da798..531c710fc73f 100755 --- a/Documentation/sphinx/parse-headers.pl +++ b/Documentation/sphinx/parse-headers.pl | |||
@@ -2,12 +2,18 @@ | |||
2 | use strict; | 2 | use strict; |
3 | use Text::Tabs; | 3 | use Text::Tabs; |
4 | 4 | ||
5 | # Uncomment if debug is needed | ||
6 | #use Data::Dumper; | ||
7 | |||
8 | # change to 1 to generate some debug prints | ||
9 | my $debug = 0; | 5 | my $debug = 0; |
10 | 6 | ||
7 | while ($ARGV[0] =~ m/^-(.*)/) { | ||
8 | my $cmd = shift @ARGV; | ||
9 | if ($cmd eq "--debug") { | ||
10 | require Data::Dumper; | ||
11 | $debug = 1; | ||
12 | next; | ||
13 | } | ||
14 | die "argument $cmd unknown"; | ||
15 | } | ||
16 | |||
11 | if (scalar @ARGV < 2 || scalar @ARGV > 3) { | 17 | if (scalar @ARGV < 2 || scalar @ARGV > 3) { |
12 | die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n"; | 18 | die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n"; |
13 | } | 19 | } |