]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-fuse: show fuse helper options for libfuse >= 3.0 34785/head
authorXiubo Li <xiubli@redhat.com>
Mon, 11 May 2020 03:53:35 +0000 (23:53 -0400)
committerXiubo Li <xiubli@redhat.com>
Wed, 8 Jul 2020 07:59:15 +0000 (03:59 -0400)
Since libfuse 3.0 the fuse_parse_cmdline have remove the showing
of usage, we must call the helper ourself.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/ceph_fuse.cc

index 26bdfbbe9fc7d080ef38d51a42394162db2218c4..1529ec2322e89c0196d92878c1412991dc7029af 100644 (file)
@@ -58,7 +58,15 @@ static void fuse_usage()
   struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv);
 #if FUSE_VERSION >= FUSE_MAKE_VERSION(3, 0)
   struct fuse_cmdline_opts opts = {};
-  if (fuse_parse_cmdline(&args, &opts) == -1) {
+  if (fuse_parse_cmdline(&args, &opts) != -1) {
+    if (opts.show_help) {
+      cout << "usage: " << argv[0] << " [options] <mountpoint>\n\n";
+      cout << "FUSE options:\n";
+      fuse_cmdline_help();
+      fuse_lowlevel_help();
+      cout << "\n";
+    }
+  } else {
 #else
   if (fuse_parse_cmdline(&args, nullptr, nullptr, nullptr) == -1) {
 #endif