From 01485adb9d07d74c0ef02f1b47cad4ce46161934 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 21 Jul 2020 08:28:04 +0200 Subject: lib/xref: add xrefs for install_element() Combined with the DEFUN xrefs, this means we can extract the full CLI tree from a binary file. Signed-off-by: David Lamparter --- lib/command.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index b34fa7ff3e..6a4d504b2f 100644 --- a/lib/command.c +++ b/lib/command.c @@ -277,7 +277,7 @@ const char *cmd_prompt(enum node_type node) } /* Install a command into a node. */ -void install_element(enum node_type ntype, const struct cmd_element *cmd) +void _install_element(enum node_type ntype, const struct cmd_element *cmd) { struct cmd_node *cnode; @@ -323,7 +323,7 @@ void install_element(enum node_type ntype, const struct cmd_element *cmd) vector_set(cnode->cmd_vector, (void *)cmd); if (ntype == VIEW_NODE) - install_element(ENABLE_NODE, cmd); + _install_element(ENABLE_NODE, cmd); } void uninstall_element(enum node_type ntype, const struct cmd_element *cmd) @@ -2344,18 +2344,18 @@ const char *host_config_get(void) void install_default(enum node_type node) { - install_element(node, &config_exit_cmd); - install_element(node, &config_quit_cmd); - install_element(node, &config_end_cmd); - install_element(node, &config_help_cmd); - install_element(node, &config_list_cmd); - install_element(node, &show_cli_graph_cmd); - install_element(node, &find_cmd); + _install_element(node, &config_exit_cmd); + _install_element(node, &config_quit_cmd); + _install_element(node, &config_end_cmd); + _install_element(node, &config_help_cmd); + _install_element(node, &config_list_cmd); + _install_element(node, &show_cli_graph_cmd); + _install_element(node, &find_cmd); - install_element(node, &config_write_cmd); - install_element(node, &show_running_config_cmd); + _install_element(node, &config_write_cmd); + _install_element(node, &show_running_config_cmd); - install_element(node, &autocomplete_cmd); + _install_element(node, &autocomplete_cmd); nb_cli_install_default(node); } -- cgit v1.2.3