diff options
Diffstat (limited to 'cli/src/cli-cmd-system.c')
-rw-r--r-- | cli/src/cli-cmd-system.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c index e9d017f1d16..36300248909 100644 --- a/cli/src/cli-cmd-system.c +++ b/cli/src/cli-cmd-system.c @@ -154,6 +154,30 @@ out: return ret; } +int +cli_cmd_getwd_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) +{ + int ret = -1; + rpc_clnt_procedure_t *proc = NULL; + call_frame_t *frame = NULL; + + if (wordcount != 2) { + cli_usage_out (word->pattern); + goto out; + } + + proc = &cli_rpc_prog->proctable[GLUSTER_CLI_GETWD]; + if (proc && proc->fn) { + frame = create_frame (THIS, THIS->ctx->pool); + if (!frame) + goto out; + ret = proc->fn (frame, THIS, NULL); + } +out: + return ret; +} + struct cli_cmd cli_system_cmds[] = { { "system:: getspec <VOLID>", cli_cmd_getspec_cbk, @@ -167,6 +191,10 @@ struct cli_cmd cli_system_cmds[] = { cli_cmd_fsm_log_cbk, "display fsm transitions"}, + { "system:: getwd", + cli_cmd_getwd_cbk, + "query glusterd work directory"}, + { "system:: help", cli_cmd_system_help_cbk, "display help for system commands"}, |