diff options
author | Mohamed Ashiq <mliyazud@redhat.com> | 2015-07-15 14:19:49 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-11-02 02:03:28 -0800 |
commit | 0b6f0e09715fb2ba8f86bd80b05d552ae75aeda9 (patch) | |
tree | 6186add585892688da794b475de3c11b218d32bd /cli/src/cli-cmd-peer.c | |
parent | 43d819bc99874ee900a03a27c79cd8523423d9b6 (diff) |
cli : 'gluster volume help' output sorted alphabetically
'gluster volume help' output is not sorted alphabetically.
This makes little harder for the user to search or get to know of
few gluster volume commands usage just from gluster cli.
Backport of http://review.gluster.org/11663
Cherry picked from 323e71617fee5020324540776d0d4469577f0afe
Change-Id: I855da2e4748a5c2ff3be319c50fa9548d676ee8a
BUG: 1276208
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
>Reviewed-on: http://review.gluster.org/11663
>Tested-by: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com>
>Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Reviewed-on: http://review.gluster.org/12452
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-peer.c')
-rw-r--r-- | cli/src/cli-cmd-peer.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-peer.c b/cli/src/cli-cmd-peer.c index 94f059df623..6568c2a1fcb 100644 --- a/cli/src/cli-cmd-peer.c +++ b/cli/src/cli-cmd-peer.c @@ -274,12 +274,20 @@ cli_cmd_peer_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, const char **words, int wordcount) { struct cli_cmd *cmd = NULL; + struct cli_cmd *probe_cmd = NULL; + int count = 0; + cmd = GF_CALLOC (1, sizeof (cli_probe_cmds), cli_mt_cli_cmd); + memcpy (cmd, cli_probe_cmds, sizeof (cli_probe_cmds)); + count = (sizeof (cli_probe_cmds) / sizeof (struct cli_cmd)); + cli_cmd_sort (cmd, count); - for (cmd = cli_probe_cmds; cmd->pattern; cmd++) - cli_out ("%s - %s", cmd->pattern, cmd->desc); + for (probe_cmd = cmd; probe_cmd->pattern; probe_cmd++) + cli_out ("%s - %s", probe_cmd->pattern, probe_cmd->desc); + + GF_FREE (cmd); return 0; } |