Commit 09226223 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Exit with usage if a invalid option is provided on command line

parent 85ba9f2d
......@@ -135,16 +135,18 @@ my $config = catfile($confdir, "default.cfg");
my $format = "text";
my $testdir = catdir($datadir, "tests");
GetOptions("verbose" => \$verbose,
"quiet" => \$quiet,
"help" => \$help,
"archive=s" => \$archive,
"config=s" => \$config,
"force" => \$force,
"format=s" => \$format,
"testdir=s" => \$testdir);
pod2usage(-verbose => $help, -output => \*STDOUT) if $help;
if (!GetOptions("verbose" => \$verbose,
"quiet" => \$quiet,
"help" => \$help,
"archive=s" => \$archive,
"config=s" => \$config,
"force" => \$force,
"format=s" => \$format,
"testdir=s" => \$testdir) || $help) {
pod2usage(-verbose => $help,
-output => $help ? \*STDOUT : \*STDERR,
-exitval => $help ? 0 : 1);
}
my $conffile;
unless (-e $config) {
......
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