From 093aba80fbea5d977bf0c585261cd40996b80ef5 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Sun, 10 May 2020 23:53:35 -0400 Subject: [PATCH] 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 --- src/ceph_fuse.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 26bdfbbe9fc..1529ec2322e 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 -- 2.39.5