summaryrefslogtreecommitdiff
path: root/vtysh/vtysh_main.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2018-05-17 13:03:11 -0400
committerGitHub <noreply@github.com>2018-05-17 13:03:11 -0400
commit21c84871cfac0eb6acdcded645ab032ee37c82b5 (patch)
tree666f0d65815b125cb904be768cc8eb0bc9e5d181 /vtysh/vtysh_main.c
parent7bed0c42d51be22d03ae3b018910317f2af4241a (diff)
parenta4364a44ae3180536b8f6faac0ca2f1404915385 (diff)
Merge pull request #2221 from rodnymolina/vtysh_extension
vtysh: Extending vtysh to allow question-mark cmds
Diffstat (limited to 'vtysh/vtysh_main.c')
-rw-r--r--vtysh/vtysh_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index cd59d8094b..3dd70983bc 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -611,7 +611,16 @@ int main(int argc, char **argv, char **env)
if (logfile)
log_it(cmd->line);
- ret = vtysh_execute_no_pager(cmd->line);
+ /*
+ * Parsing logic for regular commands will be different than
+ * for those commands requiring further processing, such as
+ * cli instructions terminating with question-mark character.
+ */
+ if (!vtysh_execute_command_questionmark(cmd->line))
+ ret = CMD_SUCCESS;
+ else
+ ret = vtysh_execute_no_pager(cmd->line);
+
if (!no_error
&& !(ret == CMD_SUCCESS || ret == CMD_SUCCESS_DAEMON
|| ret == CMD_WARNING))