]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
usability: print usage() if unknown options are used
authorSami Kerola <kerolasa@iki.fi>
Mon, 29 Aug 2016 10:09:08 +0000 (11:09 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 29 Aug 2016 10:11:05 +0000 (11:11 +0100)
It is better to burn and fail than allow recovery from unexpected user
interface usage.

mtr.c

diff --git a/mtr.c b/mtr.c
index dc99681ba6e7e0b8908b7b578266b6b247f947fe..ccf00f4d11644668c53cbaa52d3d5b2dbd000100 100644 (file)
--- a/mtr.c
+++ b/mtr.c
@@ -631,6 +631,8 @@ static void parse_arg (struct mtr_ctl *ctl, int argc, char **argv)
       error(EXIT_FAILURE, 0, "SO_MARK not enabled");
       break;
 #endif
+    default:
+      usage(stderr);
     }
   }