summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-system.c
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-04-18 17:25:25 +0000
committerAnand Avati <avati@gluster.com>2011-04-19 02:30:18 -0700
commit184fba37889b87c27af90adf357b38fa95f1e78d (patch)
treef87f0cef7efeac01a7cd0bc520e640928f221004 /cli/src/cli-cmd-system.c
parentcc6d5c66090f576383c26bd0bdefadbcad708435 (diff)
cli: implement "system:: getwd" command
Signed-off-by: Csaba Henk <csaba@lowlife.hu> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2785 (gsyncd logs on slave side go to /dev/null) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2785
Diffstat (limited to 'cli/src/cli-cmd-system.c')
-rw-r--r--cli/src/cli-cmd-system.c28
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"},