diff options
author | pjd <pjd@FreeBSD.org> | 2004-12-28 17:07:18 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-12-28 17:07:18 +0000 |
commit | c30f74a05b11c78f6b7945d2c0aabaf3f406fc9a (patch) | |
tree | 509c3a895f83299eadc460dff31186a01c0baee1 /sbin | |
parent | b007d287ccae492ca936f92addb18ee7c058b7bf (diff) | |
download | FreeBSD-src-c30f74a05b11c78f6b7945d2c0aabaf3f406fc9a.zip FreeBSD-src-c30f74a05b11c78f6b7945d2c0aabaf3f406fc9a.tar.gz |
Detect if class name is '-h' or 'help' and if it is, show general help
message, i.e.:
geom: usage: geom <class> <command> [options]
PR: bin/71537
Submitted by: bugghy <bugghy@phenix.rootshell.be>
MFC after: 5 days
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/core/geom.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 95b8a99..c093c94 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; |