From 4bb7f7c2dd35fd76db3f8d552e990f6c16f33992 Mon Sep 17 00:00:00 2001 From: Pavel Ivashchenko Date: Mon, 30 Sep 2019 15:57:10 +0000 Subject: vtysh: fix searching commands in parent nodes Do not check parent command nodes in case of ambiguous and incomplete commands Signed-off-by: Pavel Ivashchenko --- lib/command.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 7fb405bdfb..2f07367469 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1049,6 +1049,7 @@ int cmd_execute_command(vector vline, struct vty *vty, return saved_ret; if (ret != CMD_SUCCESS && ret != CMD_WARNING + && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) { /* This assumes all nodes above CONFIG_NODE are childs of * CONFIG_NODE */ @@ -1062,6 +1063,7 @@ int cmd_execute_command(vector vline, struct vty *vty, ret = cmd_execute_command_real(vline, FILTER_RELAXED, vty, cmd, 0); if (ret == CMD_SUCCESS || ret == CMD_WARNING + || ret == CMD_ERR_AMBIGUOUS || ret == CMD_ERR_INCOMPLETE || ret == CMD_NOT_MY_INSTANCE || ret == CMD_WARNING_CONFIG_FAILED) return ret; @@ -1260,6 +1262,7 @@ int command_config_read_one_line(struct vty *vty, while (!(use_daemon && ret == CMD_SUCCESS_DAEMON) && !(!use_daemon && ret == CMD_ERR_NOTHING_TODO) && ret != CMD_SUCCESS && ret != CMD_WARNING + && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED && ret != CMD_NO_LEVEL_UP) ret = cmd_execute_command_real(vline, FILTER_STRICT, vty, cmd, -- cgit v1.2.3