diff options
author | Harpreet Kaur Lalwani <hlalwani@redhat.com> | 2018-11-21 16:13:36 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-12-04 09:28:11 +0000 |
commit | 8e8f4bf3fa16d3790a5eb74b8f07b904024ee9d8 (patch) | |
tree | 33f13742f00e9872940a2cd1a1f163ccc6c25a9e /cli/src/cli.h | |
parent | 54ebd47e4154c8b37680b2bac43775fc92ced153 (diff) |
cli: "usage()" and "--help" for gluster cli
Added a usage message which will be shown when a user enters an
"unrecognized word" or an "unrecognized command" on the cli.
Also added a "--help" option for gluster cli.
fixes: bz#1535495
Change-Id: Ibcfb3d1c84daa1054e09c5cdfa6a5dab19f534a6
Signed-off-by: Harpreet Kaur Lalwani <hlalwani@redhat.com>
Diffstat (limited to 'cli/src/cli.h')
-rw-r--r-- | cli/src/cli.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/src/cli.h b/cli/src/cli.h index 773297e4be8..2c2b4355111 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -239,6 +239,19 @@ _cli_err(const char *fmt, ...); \ } while (0) +#define usage() \ + do { \ + cli_out( \ + " Usage: gluster [options] <help> <peer>" \ + " <pool> <volume>\n" \ + " Options:\n" \ + " --help Shows the help information\n" \ + " --version Shows the version\n" \ + " --print-logdir Shows the log directory\n" \ + " --print-statedumpdir Shows the state dump directory\n"); \ + \ + } while (0) + int cli_submit_request(struct rpc_clnt *rpc, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, struct iobref *iobref, |