diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-18 10:13:52 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-18 10:13:52 -0800 |
commit | fb55afa742b7976f9d22e7f0136756f25549d5c9 (patch) | |
tree | 87ee40ddef80859d1d420a76a8fc1f0289715926 /scripts/vyatta-show-interfaces.pl | |
parent | cf6dc75cbc85c5766cc1ac8601730163aa3748ae (diff) | |
download | vyatta-op-fb55afa742b7976f9d22e7f0136756f25549d5c9.tar.gz vyatta-op-fb55afa742b7976f9d22e7f0136756f25549d5c9.zip |
Invalid action should cause usage message
Don't expect this script used directly, but make it more useful.
Diffstat (limited to 'scripts/vyatta-show-interfaces.pl')
-rwxr-xr-x | scripts/vyatta-show-interfaces.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index 46f024a..4d89bc3 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -343,7 +343,7 @@ sub usage { print " NAME = ", join(' | ', get_intf_for_type()), "\n"; print " TYPE = ", join(' | ', Vyatta::Interface::interface_types()), "\n"; print " ACTION = ", join(' | ', keys %action_hash), "\n"; - exit 0; + exit 1; } # @@ -376,7 +376,8 @@ my $func; if (defined $action_hash{$action}) { $func = $action_hash{$action}; } else { - die "Invalid action [$action]\n"; + print "Invalid action [$action]\n"; + usage(); } # |