]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: rework DEFPY processing in extract.pl 6777/head
authorIgor Ryzhov <iryzhov@nfware.com>
Mon, 20 Jul 2020 15:15:49 +0000 (18:15 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 20 Jul 2020 15:18:55 +0000 (18:18 +0300)
Currently, all DEFPY commands are translated into one-liners in
vtysh_cmd.c. After the patch, DEFPY commands are correctly indented just
like DEFUN/ALIAS commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/command.h
vtysh/extract.pl.in

index 21bb6135400a294e5e4934ce38693a590f7f20ea..1acca906651e3713c29ccda625910cb01f563627 100644 (file)
@@ -328,18 +328,6 @@ struct cmd_node {
        DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr,                  \
                          CMD_ATTR_DEPRECATED, daemon)
 
-#else /* VTYSH_EXTRACT_PL */
-#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)
-
-#define DEFPY_HIDDEN(funcname, cmdname, cmdstr, helpstr)                       \
-       DEFUN_HIDDEN(funcname, cmdname, cmdstr, helpstr)
 #endif /* VTYSH_EXTRACT_PL */
 
 /* Some macroes */
index 794e1f4c7383698d084f559dd9540d47785db963..061f7b0ffea94f4d6d78099b0c48f17f90a96d87 100755 (executable)
@@ -48,7 +48,7 @@ sub scan_file {
     }
 
     # ?: makes a group non-capturing
-    @defun = ($line =~ /((?:DEFUN|DEFUN_HIDDEN|ALIAS|ALIAS_HIDDEN)\s*\(.+?\));?\s?\s?\n/sg);
+    @defun = ($line =~ /((?:DEFUN|DEFUN_HIDDEN|ALIAS|ALIAS_HIDDEN|DEFPY|DEFPY_HIDDEN)\s*\(.+?\));?\s?\s?\n/sg);
     @install = ($line =~ /install_element\s*\(\s*[0-9A-Z_]+,\s*&[^;]*;\s*\n/sg);
 
     # DEFUN process