aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.md4
-rwxr-xr-xsbocheck5
-rwxr-xr-xsboclean7
-rwxr-xr-xsboconfig7
-rwxr-xr-xsbofind7
-rwxr-xr-xsboinstall7
-rwxr-xr-xsboupgrade7
7 files changed, 33 insertions, 11 deletions
diff --git a/ChangeLog.md b/ChangeLog.md
index fd5285b..45089ce 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
- Download's are retried from a third party on failure. Allow the user to
configure the third party source or disable this feature.
+### Fixed
+
+ - Bail out early when bad command line arguments are given.
+
### Security
- Check SSL certificates when downloading. Oddly, this was previously
diff --git a/sbocheck b/sbocheck
index bf2ddff..2da4b90 100755
--- a/sbocheck
+++ b/sbocheck
@@ -37,7 +37,10 @@ EOF
my ($help, $vers);
-GetOptions('help|h' => \$help, 'version|v' => \$vers);
+if (! GetOptions('help|h' => \$help, 'version|v' => \$vers)) {
+ show_usage();
+ exit 1;
+}
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }
diff --git a/sboclean b/sboclean
index 980de44..26594e8 100755
--- a/sboclean
+++ b/sboclean
@@ -42,13 +42,16 @@ EOF
my ($help, $vers, $dist, $work, $interactive);
-GetOptions(
+if (! GetOptions(
'help|h' => \$help,
'version|v' => \$vers,
'dist|clean-dist|d' => \$dist,
'work|clean-work|w' => \$work,
'interactive|i' => \$interactive,
-);
+)) {
+ show_usage();
+ exit 1;
+}
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }
diff --git a/sboconfig b/sboconfig
index 32058b8..e413ad8 100755
--- a/sboconfig
+++ b/sboconfig
@@ -62,7 +62,7 @@ EOF
my %options;
-GetOptions(\%options,
+if (! GetOptions(\%options,
'help|h',
'version|v',
'list|l',
@@ -76,7 +76,10 @@ GetOptions(\%options,
'slackware-version|V=s',
'repo|r=s',
'gpg-key|g=s',
-);
+)) {
+ show_usage();
+ exit 1;
+}
if ($options{help}) { show_usage(); exit 0 }
if ($options{version}) { show_version(); exit 0 }
diff --git a/sbofind b/sbofind
index 8ea7934..8eca349 100755
--- a/sbofind
+++ b/sbofind
@@ -43,7 +43,7 @@ EOF
my ($help, $vers, $search_exact, $exclude_tags, $show_info, $show_readme, $show_queue);
-GetOptions(
+if (! GetOptions(
'help|h' => \$help,
'version|v' => \$vers,
'exact|e' => \$search_exact,
@@ -51,7 +51,10 @@ GetOptions(
'info|i' => \$show_info,
'readme|r' => \$show_readme,
'queue|q' => \$show_queue,
-);
+)) {
+ show_usage();
+ exit 1;
+}
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }
diff --git a/sboinstall b/sboinstall
index 73fb2f4..c2f2420 100755
--- a/sboinstall
+++ b/sboinstall
@@ -61,7 +61,7 @@ my $distclean = $config{DISTCLEAN};
my $jobs = $config{JOBS};
my ($help, $vers, $no_install, $non_int, $no_reqs, $compat32, $ctemp, $utemp, $reinstall);
-GetOptions(
+if (! GetOptions(
'help|h' => \$help,
'version|v' => \$vers,
'noclean|c=s' => \$noclean,
@@ -74,7 +74,10 @@ GetOptions(
'reinstall' => \$reinstall,
'create-template=s' => \$ctemp,
'use-template=s' => \$utemp,
-);
+)) {
+ show_usage();
+ exit 1;
+}
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }
diff --git a/sboupgrade b/sboupgrade
index 81a9a3f..c1363c2 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -55,7 +55,7 @@ my $distclean = $config{DISTCLEAN};
my $jobs = $config{JOBS};
my ($help, $vers, $force, $no_install, $non_int, $force_reqs, $all);
-GetOptions(
+if (! GetOptions(
'help|h' => \$help,
'version|v' => \$vers,
'noclean|c=s' => \$noclean,
@@ -66,7 +66,10 @@ GetOptions(
'nointeractive|r' => \$non_int,
'force-reqs|z' => \$force_reqs,
'all' => \$all,
-);
+)) {
+ show_usage();
+ exit 1;
+}
if ($help) { show_usage(); exit 0 }
if ($vers) { show_version(); exit 0 }