extra logic to correctly parse options given with a #! in a self-plotting data file

This commit is contained in:
Dima Kogan 2010-02-05 12:05:52 -08:00
parent 59da3af4b0
commit 68843f226e

View File

@ -94,6 +94,16 @@ As an example, if line 3 of the input is "0 9 1 20"
debugging. debugging.
OEF OEF
# if I'm using a self-plotting data file with a #! line, then $ARGV[0] will contain ALL of the
# options and $ARGV[1] will contain the data file to plot. In this case I need to split $ARGV[0] so
# that GetOptions() can parse it correctly. On the other hand, if I'm plotting normally (not with
# #!) a file with spaces in the filename, I don't want to split the filename. Hopefully this logic
# takes care of both those cases.
if(exists $ARGV[0] && !-r $ARGV[0])
{
unshift @ARGV, split(/\s+/, shift(@ARGV));
}
# do not stream in the data by default # do not stream in the data by default
# point plotting by default # point plotting by default
my %options = ( "stream" => 0, my %options = ( "stream" => 0,