From c22789620db38f388e5800d6d0e3b708b44be2f5 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 3 Jun 2021 00:29:51 +0300 Subject: lib, vtysh: reduce code duplication Signed-off-by: Igor Ryzhov --- lib/command.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 7fb405bdfb..a5b62e9076 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2231,11 +2231,7 @@ DEFUN (no_banner_motd, return CMD_SUCCESS; } -DEFUN(find, - find_cmd, - "find REGEX...", - "Find CLI command matching a regular expression\n" - "Search pattern (POSIX regex)\n") +int cmd_find_cmds(struct vty *vty, struct cmd_token **argv, int argc) { const struct cmd_node *node; const struct cmd_element *cli; @@ -2313,6 +2309,15 @@ done: return CMD_SUCCESS; } +DEFUN(find, + find_cmd, + "find REGEX...", + "Find CLI command matching a regular expression\n" + "Search pattern (POSIX regex)\n") +{ + return cmd_find_cmds(vty, argv, argc); +} + #if defined(DEV_BUILD) && defined(HAVE_SCRIPTING) DEFUN(script, script_cmd, -- cgit v1.2.3