summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-cmd.c')
-rw-r--r--cli/src/cli-cmd.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c
index f09c6210634..2b9aea191df 100644
--- a/cli/src/cli-cmd.c
+++ b/cli/src/cli-cmd.c
@@ -60,6 +60,38 @@ cli_cmd_needs_connection (struct cli_cmd_word *word)
}
int
+cli_cmd_status_reset (void)
+{
+ int ret = 0;
+
+ ret = cli_cmd_lock ();
+ {
+ if (ret == 0) {
+ cmd_sent = 0;
+ cmd_done = 0;
+ }
+ }
+ ret = cli_cmd_unlock ();
+ return ret;
+
+}
+
+int
+cli_cmd_sent_status_get (int *status)
+{
+ int ret = 0;
+ GF_ASSERT (status);
+
+ ret = cli_cmd_lock ();
+ {
+ if (ret == 0)
+ *status = cmd_sent;
+ }
+ ret = cli_cmd_unlock ();
+ return ret;
+}
+
+int
cli_cmd_process (struct cli_state *state, int argc, char **argv)
{
int ret = 0;
@@ -112,11 +144,10 @@ cli_cmd_process (struct cli_state *state, int argc, char **argv)
callback:
ret = word->cbkfn (state, word, (const char **)argv, argc);
-
+ (void) cli_cmd_status_reset ();
return ret;
}
-
int
cli_cmd_input_token_count (const char *text)
{