]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-fuse: trim ceph-fuse -V output 20798/head
authorJos Collin <jcollin@redhat.com>
Thu, 8 Mar 2018 13:12:25 +0000 (18:42 +0530)
committerJos Collin <jcollin@redhat.com>
Tue, 13 Mar 2018 14:49:05 +0000 (20:19 +0530)
Trim 'ceph-fuse -V' output to print the FUSE library version and exit.

Fixes: http://tracker.ceph.com/issues/23248
Signed-off-by: Jos Collin <jcollin@redhat.com>
src/ceph_fuse.cc

index 6e2d21792f605f95812150684a9494d15125d018..8657c5fdd8c72554da64480a0b11f3d984c439b8 100644 (file)
@@ -97,6 +97,19 @@ int main(int argc, const char **argv, const char *envp[]) {
       filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS;
     } else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)nullptr)) {
       usage();
+    } else if (ceph_argparse_flag(args, i, "-V", (char*)nullptr)) {
+      const char* tmpargv[] = {
+       "ceph-fuse",
+       "-V"
+      };
+
+      struct fuse_args fargs = FUSE_ARGS_INIT(2, (char**)tmpargv);
+      if (fuse_parse_cmdline(&fargs, nullptr, nullptr, nullptr) == -1) {
+       derr << "fuse_parse_cmdline failed." << dendl;
+      }
+      assert(fargs.allocated);
+      fuse_opt_free_args(&fargs);
+      exit(0);
     } else {
       ++i;
     }