From: Ivan Kanakarakis <[email protected]>

now if the command is unkown we get a message like:
$ ./scripts/pacman-key --foo
Uknown command: --foo
<..usage..>

---
 scripts/pacman-key.sh.in |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 5323f68..7261c89 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -344,16 +344,23 @@ case "${command}" in
         exit $ret
         ;;
     -h|--help)
-        usage; 
-        exit 0 
+        usage
+        exit 0
         ;;
     -V|--version)
-        version; 
-        exit 0 
+        version
+        exit 0
+        ;;
+    # Parameters already handled
+    --config)
+        shift
+        ;;
+    --gpgdir)
+        shift
+        ;;
+    *)
+        error "$(gettext "Unknown command: $command")"
+        usage
+        exit 1
         ;;
-        # Parameters already handled
-        --config) shift ;;
-    --gpgdir) shift ;;
-*)
-    usage; exit 1 ;;
 esac
-- 
1.7.4.4


Reply via email to