From 26d19c83b412b49e8e99365ec356e25d85d1da72 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sun, 8 Jul 2018 19:02:36 -0300 Subject: [PATCH] lib: implement DEFPY_NOSH This is the DEFPY equivalent of DEFUN_NOSH. Signed-off-by: Renato Westphal --- lib/command.h | 6 ++++++ lib/defun_lex.l | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/command.h b/lib/command.h index a001a90e2e..da9b92ec6d 100644 --- a/lib/command.h +++ b/lib/command.h @@ -220,6 +220,9 @@ struct cmd_node { DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, 0, 0) \ funcdecl_##funcname +#define DEFPY_NOSH(funcname, cmdname, cmdstr, helpstr) \ + DEFPY(funcname, cmdname, cmdstr, helpstr) + #define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \ DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, attr, 0) \ funcdecl_##funcname @@ -302,6 +305,9 @@ struct cmd_node { #define DEFPY(funcname, cmdname, cmdstr, helpstr) \ DEFUN(funcname, cmdname, cmdstr, helpstr) +#define DEFPY_NOSH(funcname, cmdname, cmdstr, helpstr) \ + DEFUN_NOSH(funcname, cmdname, cmdstr, helpstr) + #define DEFPY_ATTR(funcname, cmdname, cmdstr, helpstr, attr) \ DEFUN_ATTR(funcname, cmdname, cmdstr, helpstr, attr) #endif /* VTYSH_EXTRACT_PL */ diff --git a/lib/defun_lex.l b/lib/defun_lex.l index 9c995db266..d901c26a2e 100644 --- a/lib/defun_lex.l +++ b/lib/defun_lex.l @@ -132,6 +132,7 @@ SPECIAL [(),] "DEFUN_NOSH" value = strdup(yytext); return DEFUNNY; "DEFUN_HIDDEN" value = strdup(yytext); return DEFUNNY; "DEFPY" value = strdup(yytext); return DEFUNNY; +"DEFPY_NOSH" value = strdup(yytext); return DEFUNNY; "DEFPY_ATTR" value = strdup(yytext); return DEFUNNY; "DEFPY_HIDDEN" value = strdup(yytext); return DEFUNNY; "ALIAS" value = strdup(yytext); return DEFUNNY; -- 2.39.5