From: Xiubo Li Date: Mon, 11 May 2020 03:53:35 +0000 (-0400) Subject: ceph-fuse: show fuse helper options for libfuse >= 3.0 X-Git-Tag: v16.1.0~1746^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34785%2Fhead;p=ceph.git ceph-fuse: show fuse helper options for libfuse >= 3.0 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 --- diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 26bdfbbe9fc7d..1529ec2322e89 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -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] \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