summaryrefslogtreecommitdiff
path: root/lib/command.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2020-04-28 15:19:24 +0200
committerDavid Lamparter <equinox@diac24.net>2021-02-01 17:28:11 +0100
commitfeb06e7a93af3642d23cad951e2eaf544025f64a (patch)
tree06e07eb6c26b661b3fb152ec07f585cd499f1785 /lib/command.h
parent131879fb926798bfefd80b0e2cba266919c5be1d (diff)
lib/xref: add xrefs for DEFUNs
This allows grabbing a list of all DEFUNs and their help texts through the xref extraction mechanics. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/command.h')
-rw-r--r--lib/command.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/command.h b/lib/command.h
index b002e79f09..6acaa450c2 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -239,7 +239,11 @@ struct cmd_node {
.attr = attrs, \
.daemon = dnum, \
.name = #cmdname, \
- };
+ .xref = XREF_INIT(XREFT_DEFUN, NULL, #funcname), \
+ }; \
+ XREF_LINK(cmdname.xref); \
+ /* end */
+
#define DEFUN_CMD_FUNC_DECL(funcname) \
static int funcname(const struct cmd_element *, struct vty *, int, \