diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2018-05-17 13:03:11 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-17 13:03:11 -0400 |
| commit | 21c84871cfac0eb6acdcded645ab032ee37c82b5 (patch) | |
| tree | 666f0d65815b125cb904be768cc8eb0bc9e5d181 /vtysh/vtysh_main.c | |
| parent | 7bed0c42d51be22d03ae3b018910317f2af4241a (diff) | |
| parent | a4364a44ae3180536b8f6faac0ca2f1404915385 (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.c | 11 |
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)) |
