diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-05-22 16:57:39 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-05-22 16:57:39 +0000 |
commit | b70eccf3bdb7c84ce97d5d4946e45d1ec2e197aa (patch) | |
tree | c9e7c8f55564999d21e164054b0f78ed44fd51fb /sbin | |
parent | 96818a07a7943de640aa2e75edaa0e4075677deb (diff) | |
download | src-b70eccf3bdb7c84ce97d5d4946e45d1ec2e197aa.tar.gz src-b70eccf3bdb7c84ce97d5d4946e45d1ec2e197aa.zip |
Notes
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/core/geom.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 613eb4113bce..963b1bc000fb 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -60,11 +60,13 @@ static void (*usage)(const char *name); static struct g_command *find_command(const char *cmdstr, int all); static int std_available(const char *name); +static void std_help(struct gctl_req *req, unsigned flags); static void std_list(struct gctl_req *req, unsigned flags); static void std_load(struct gctl_req *req, unsigned flags); static void std_unload(struct gctl_req *req, unsigned flags); struct g_command std_commands[] = { + { "help", 0, std_help, G_NULL_OPTS }, { "list", 0, std_list, G_NULL_OPTS }, { "load", G_FLAG_VERBOSE | G_FLAG_LOADKLD, std_load, G_NULL_OPTS }, { "unload", G_FLAG_VERBOSE, std_unload, G_NULL_OPTS }, @@ -110,8 +112,8 @@ geom_usage(void) { if (class_name == NULL) { - errx(EXIT_FAILURE, "usage: %s <class name> <command> " - "[options]", "geom"); + errx(EXIT_FAILURE, "usage: %s <class> <command> [options]", + "geom"); } else { const char *prefix; unsigned i; @@ -597,6 +599,13 @@ show_one(struct gprovider *pp) printf("\n"); } +static void +std_help(struct gctl_req *req __unused, unsigned flags __unused) +{ + + geom_usage(); +} + static int std_list_available(void) { @@ -743,7 +752,9 @@ static int std_available(const char *name) { - if (strcmp(name, "list") == 0) + if (strcmp(name, "help") == 0) + return (1); + else if (strcmp(name, "list") == 0) return (std_list_available()); else if (strcmp(name, "load") == 0) return (std_load_available()); |