aboutsummaryrefslogtreecommitdiffstats
path: root/example/fuse_lo-plus.c
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2016-10-09 17:08:29 -0700
committerNikolaus Rath <Nikolaus@rath.org>2016-10-09 22:03:07 -0700
commit225c12aebf2d2f27e1d032d6b2149c7bb1d63506 (patch)
treecb975230f69f925fae7c559bdb3d8faa867f537f /example/fuse_lo-plus.c
parent1014e1fc931f3c8191be3767f789160a69b01381 (diff)
downloadlibfuse-225c12aebf2d2f27e1d032d6b2149c7bb1d63506.tar.gz
fuse_parse_cmdline(): do not print help/version text
The current behavior makes it difficult to add help for additional options. With the change, this becomes a lot easier.
Diffstat (limited to 'example/fuse_lo-plus.c')
-rw-r--r--example/fuse_lo-plus.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/example/fuse_lo-plus.c b/example/fuse_lo-plus.c
index 60c2daf..c27f377 100644
--- a/example/fuse_lo-plus.c
+++ b/example/fuse_lo-plus.c
@@ -452,10 +452,21 @@ int main(int argc, char *argv[])
if (fuse_parse_cmdline(&args, &opts) != 0)
return 1;
- if (opts.show_help || opts.show_version) {
- ret = 1;
+ if (opts.show_help) {
+ printf("usage: %s [options] <mountpoint>\n\n", argv[0]);
+ fuse_cmdline_help();
+ fuse_lowlevel_help();
+ fuse_mount_help();
+ ret = 0;
+ goto err_out1;
+ } else if (opts.show_version) {
+ printf("FUSE library version %s\n", fuse_pkgversion());
+ fuse_lowlevel_version();
+ fuse_mount_version();
+ ret = 0;
goto err_out1;
}
+
lo.debug = opts.debug;
lo.root.next = lo.root.prev = &lo.root;
lo.root.fd = open("/", O_PATH);