From: Mauro Carvalho Chehab Date: Wed, 31 Aug 2016 09:41:40 +0000 (-0300) Subject: [media] docs-rst: parse-headers.pl: make debug a command line option X-Git-Tag: v4.9-rc1~43^2~231 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=bcec7c218d5aeb170d18c49a33f9bd36ddf9ee37;p=uclinux-h8%2Flinux.git [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 Signed-off-by: Mauro Carvalho Chehab --- 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 @@ 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 []\n"; }