diff options
author | Slack Coder <slackcoder@server.ky> | 2025-02-20 14:57:16 -0500 |
---|---|---|
committer | Slack Coder <slackcoder@server.ky> | 2025-02-20 15:11:39 -0500 |
commit | b38ab95e21d572cc0798fee0505c009a6b7587b6 (patch) | |
tree | c5c880ce69f235764bde0e9f4dbef6e034c89e87 /SBO-Lib/lib/SBO/App.pm | |
parent | 6562db4c47319f40ec0d045c725f9766a56e7e5a (diff) | |
download | sbotools2-b38ab95e21d572cc0798fee0505c009a6b7587b6.tar.xz |
Fail on bad arguments for remaining commands
Diffstat (limited to 'SBO-Lib/lib/SBO/App.pm')
-rw-r--r-- | SBO-Lib/lib/SBO/App.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/SBO-Lib/lib/SBO/App.pm b/SBO-Lib/lib/SBO/App.pm index d8de5c6..d06c2f2 100644 --- a/SBO-Lib/lib/SBO/App.pm +++ b/SBO-Lib/lib/SBO/App.pm @@ -17,10 +17,17 @@ our $VERSION = '2.8.0'; sub new { my $class = shift; - my $self = $class->_parse_opts(@_); + my ($self, $res) = $class->_parse_opts(@_); $self->{fname} = basename( (caller(0))[1] ); - return bless $self, $class; + my $obj = bless $self, $class; + + if (! $res ) { + $obj->show_usage(); + exit 1; + } + + return $obj; } 1; |