From 687b001501d8a25f0257be8b3988781fc042ce39 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 28 Dec 2004 17:07:18 +0000 Subject: [PATCH] Detect if class name is '-h' or 'help' and if it is, show general help message, i.e.: geom: usage: geom [options] PR: bin/71537 Submitted by: bugghy MFC after: 5 days --- sbin/geom/core/geom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 95b8a990ad78..c093c945a23c 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -523,6 +523,12 @@ get_class(int *argc, char ***argv) if (strcmp(comm, "geom") == 0) { if (*argc < 2) geom_usage(); + else if (*argc == 2) { + if (strcmp((*argv)[1], "-h") == 0 || + strcmp((*argv)[1], "help") == 0) { + geom_usage(); + } + } strlcatf(comm, sizeof(comm), " %s", (*argv)[1]); class_name = (*argv)[1]; *argc -= 2;