From e7dd072502e2677857bb87f8f6f8dc31cebb3054 Mon Sep 17 00:00:00 2001 From: Darold Date: Sun, 15 Apr 2012 17:41:05 +0200 Subject: [PATCH] If there is just one argument, assume it is the logfile and use default value for all other parameters --- pgbadger | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pgbadger b/pgbadger index 1fb0836..3248852 100755 --- a/pgbadger +++ b/pgbadger @@ -78,6 +78,12 @@ if ($ver) { exit 0; } &usage() if ($help); +# If we just have one command line argument assume it's the log file +# and use default values for all other ones. +if ($#ARGV == 0) { + $logfile = shift(@ARGV); +} +# Logfile is a mandatory parameter if (!$logfile) { print STDERR "FATAL: you must set a log file. See option -l.\n\n"; &usage(); -- 2.40.0