From: Wei Feng Date: Wed, 9 Dec 2015 08:58:32 +0000 (-0500) Subject: ceph-fuse: add process to ceph-fuse --help X-Git-Tag: v10.0.2~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9409e96aed8bab92d48cc52b919764a5cd00dffb;p=ceph.git ceph-fuse: add process to ceph-fuse --help Signed-off-by: Wei Feng --- diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 4d166ebd388..6d5c946a0fd 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -37,9 +37,32 @@ using namespace std; #include #include +#include + +static void fuse_usage() +{ + const char **argv = (const char **) malloc((2) * sizeof(char *)); + argv[0] = "ceph-fuse"; + argv[1] = "-h"; + struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv); + if (fuse_parse_cmdline(&args, NULL, NULL, NULL) == -1) { + derr << "fuse_parse_cmdline failed." << dendl; + fuse_opt_free_args(&args); + free(argv); + } + + assert(args.allocated); // Checking fuse has realloc'd args so we can free newargv + free(argv); +} void usage() { - cerr << "usage: ceph-fuse [-m mon-ip-addr:mon-port] " << std::endl; + cout << +"usage: ceph-fuse [-m mon-ip-addr:mon-port] [OPTIONS]\n" +" --client_mountpoint/-r \n" +" use root_directory as the mounted root, rather than the full Ceph tree.\n" +"\n"; + fuse_usage(); + generic_client_usage(); } int main(int argc, const char **argv, const char *envp[]) { @@ -57,6 +80,9 @@ int main(int argc, const char **argv, const char *envp[]) { } else if (ceph_argparse_flag(args, i, "--localize-reads", (char*)NULL)) { cerr << "setting CEPH_OSD_FLAG_LOCALIZE_READS" << std::endl; filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS; + } else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) { + usage(); + assert(0); } else { ++i; }