diff options
Diffstat (limited to 'cli/src/cli-cmd-system.c')
-rw-r--r-- | cli/src/cli-cmd-system.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c index d71f622ba11..89d7d23187e 100644 --- a/cli/src/cli-cmd-system.c +++ b/cli/src/cli-cmd-system.c @@ -572,11 +572,19 @@ int cli_cmd_system_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 *cmd = NULL; + struct cli_cmd *system_cmd = NULL; + int count = 0; + + cmd = GF_CALLOC (1, sizeof (cli_system_cmds), cli_mt_cli_cmd); + memcpy (cmd, cli_system_cmds, sizeof (cli_system_cmds)); + count = (sizeof (cli_system_cmds) / sizeof (struct cli_cmd)); + cli_cmd_sort (cmd, count); - for (cmd = cli_system_cmds; cmd->pattern; cmd++) - cli_out ("%s - %s", cmd->pattern, cmd->desc); + for (system_cmd = cmd; system_cmd->pattern; system_cmd++) + cli_out ("%s - %s", system_cmd->pattern, system_cmd->desc); + GF_FREE (cmd); return 0; } |