Commit 0e3edc70 authored by Kevin Harms's avatar Kevin Harms

Set the default darshan-job-summary pdf output based on the filename.

fixes 54



git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@484 3b7491f3-a168-0410-bf4b-c445ed680a29
parent e28cfbca
...@@ -11,6 +11,7 @@ use lib "@prefix@/lib"; ...@@ -11,6 +11,7 @@ use lib "@prefix@/lib";
use TeX::Encode; use TeX::Encode;
use Encode; use Encode;
use File::Temp qw/ tempdir /; use File::Temp qw/ tempdir /;
use File::Basename;
use Cwd; use Cwd;
use Getopt::Long; use Getopt::Long;
use English; use English;
...@@ -1322,8 +1323,25 @@ sub process_args ...@@ -1322,8 +1323,25 @@ sub process_args
print_help(); print_help();
exit(1); exit(1);
} }
$input_file = $ARGV[0]; $input_file = $ARGV[0];
# give default output file a similar name to the input file.
# log.darshan.gz => log.pdf
# log_name => log_name.pdf
if (not $opt_output)
{
$output_file = basename($input_file);
if ($output_file =~ /\.darshan\.gz$/)
{
$output_file =~ s/\.darshan\.gz$/\.pdf/;
}
else
{
$output_file .= ".pdf";
}
}
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment