diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index 60b9fe4652..8cc209eab2 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -65,6 +65,8 @@ runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ] --subject=s subject for the e-mail --param=s parameters for the report --store-results store the result of the report + --separator separator character for csv + --quote quote character for csv --csv-header add column names as first line of csv output @@ -95,6 +97,11 @@ Current options are text, html, csv, and tsv. At the moment, text and tsv both p Separator character, only for csv format. Default to comma. +=item B<--quote> + +Quote character, only for csv format. Default to double quote. +Empty string is allowed. + =item B<--email> Whether to use e-mail (implied by --to or --from). @@ -191,6 +198,7 @@ my $quote = '"'; my $store_results = 0; my $csv_header = 0; my $csv_separator = ""; +my $csv_quote = ""; my $username = undef; my $password = undef; @@ -204,6 +212,7 @@ GetOptions( 'verbose' => \$verbose, 'format=s' => \$format, 'separator=s' => \$csv_separator, + 'quote=s' => \$csv_quote, 'to=s' => \$to, 'from=s' => \$from, 'subject=s' => \$subject, @@ -237,6 +246,14 @@ if ($csv_separator) { } } +if ($csv_quote) { + if ( $format eq 'csv' ) { + $quote = "$csv_quote"; + } else { + print STDERR "Cannot specify quote if not using CSV format\n"; + } +} + if ($format eq 'tsv' || $format eq 'text') { $format = 'csv'; $separator = "\t";