From ad005978f76c3f5f6d533c4e3f13b5ed39e43173 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Sat, 7 Jan 2006 10:14:34 +0000 Subject: fix --- lib/fuse_lowlevel.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'lib/fuse_lowlevel.c') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index d1b4b36..2018c94 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -893,20 +893,45 @@ static void fuse_ll_process(void *data, const char *buf, size_t len, } } +enum { + KEY_HELP, + KEY_VERSION, +}; + static struct fuse_opt fuse_ll_opts[] = { { "debug", offsetof(struct fuse_ll, debug), 1 }, { "-d", offsetof(struct fuse_ll, debug), 1 }, { "allow_root", offsetof(struct fuse_ll, allow_root), 1 }, + FUSE_OPT_KEY("-h", KEY_HELP), + FUSE_OPT_KEY("--help", KEY_HELP), + FUSE_OPT_KEY("-V", KEY_VERSION), + FUSE_OPT_KEY("--version", KEY_VERSION), FUSE_OPT_END }; +static void fuse_ll_version(void) +{ + fprintf(stderr, "using FUSE kernel interface version %i.%i\n", + FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION); +} + static int fuse_ll_opt_proc(void *data, const char *arg, int key, struct fuse_args *outargs) { - (void) data; - (void) key; - (void) outargs; - fprintf(stderr, "fuse: unknown option `%s'\n", arg); + (void) data; (void) outargs; + + switch (key) { + case KEY_HELP: + break; + + case KEY_VERSION: + fuse_ll_version(); + break; + + default: + fprintf(stderr, "fuse: unknown option `%s'\n", arg); + } + return -1; } -- cgit v1.2.3