summaryrefslogtreecommitdiffstats
path: root/Documentation/sphinx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-31 06:41:40 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-09 09:20:06 -0300
commitbcec7c218d5aeb170d18c49a33f9bd36ddf9ee37 (patch)
treea70446ffac9c3335e807a184a45bba2688716256 /Documentation/sphinx
parentc92bab5e1ef4e709001cec678fc7c8f9817a4b2e (diff)
downloadop-kernel-dev-bcec7c218d5aeb170d18c49a33f9bd36ddf9ee37.zip
op-kernel-dev-bcec7c218d5aeb170d18c49a33f9bd36ddf9ee37.tar.gz
[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>
Diffstat (limited to 'Documentation/sphinx')
-rwxr-xr-xDocumentation/sphinx/parse-headers.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index 74089b0..531c710 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -2,12 +2,18 @@
use strict;
use Text::Tabs;
-# Uncomment if debug is needed
-#use Data::Dumper;
-
-# change to 1 to generate some debug prints
my $debug = 0;
+while ($ARGV[0] =~ m/^-(.*)/) {
+ my $cmd = shift @ARGV;
+ if ($cmd eq "--debug") {
+ require Data::Dumper;
+ $debug = 1;
+ next;
+ }
+ die "argument $cmd unknown";
+}
+
if (scalar @ARGV < 2 || scalar @ARGV > 3) {
die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
}
OpenPOWER on IntegriCloud