Subject: | Need to specify comment syntax |
Various Verilog-parsing programs allow putting the sometimes very
lengthy option lists into files. Unfortunately, these parsers use "//"
to indicate a comment rather than "#". I would like to have an
additional switch available called "comment" which gives a regular
expression for the start-of-comment character(s). I have already
implemented this functionality and have supplied a patch file.
Subject: | patch.txt |
*** orig/Getopt/ArgvFile.pm 2007-04-21 13:26:47.000000000 -0500
--- Getopt/ArgvFile.pm 2009-11-17 14:33:10.000000000 -0600
***************
*** 335,341 ****
script. They can be stored exactly as they would be written in
the command line, but may be spread to multiple lines. To make the
! file more readable, space and comment lines (starting with a "#")
! are allowed additionally. POD comments are supported as well.
! For example, the call
> script -optA argA -optB -optC cArg par1 par2
--- 335,342 ----
script. They can be stored exactly as they would be written in
the command line, but may be spread to multiple lines. To make the
! file more readable, space and comment lines (starting with a "#" or
! whatever string is specified in the C<option> switch) are allowed
! additionally. POD comments are supported as well. For example, the
! call
> script -optA argA -optB -optC cArg par1 par2
***************
*** 626,629 ****
--- 627,632 ----
my %switches=@_;
+ $switches{comment} ||= '#';
+
# perform more parameter checks
confess('[BUG] The "array" parameter value is no array reference.') if exists $switches{array} and not (ref($switches{array}) and ref($switches{array}) eq 'ARRAY');
***************
*** 776,780 ****
# skip space and comment lines (including POD)
! next if /^\s*$/ || /^\s*\#/ || $pod;
# remove newlines, leading and trailing spaces
--- 779,783 ----
# skip space and comment lines (including POD)
! next if /^\s*$/ || /^\s*(?:$switches{comment})/ || $pod;
# remove newlines, leading and trailing spaces