VTY: improve VTY prompt and make sure exit/end works everywhere
Some nodes below 'config' didn't have ournode_exit / ournode_end,
and thus were not able to properly perform this function. exit should
always only go back one level, while end drops us back to ENABLE_NODE.
The prompt now represents the nesting level, and there's one consistent
space after the final prompt character (typically #).
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
index 1646b59..220e960 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
@@ -47,19 +47,19 @@
static struct cmd_node nat_node = {
NAT_NODE,
- "%s(nat)#",
+ "%s(config-nat)# ",
1,
};
static struct cmd_node bsc_node = {
NAT_BSC_NODE,
- "%s(bsc)#",
+ "%s(config-nat-bsc)# ",
1,
};
static struct cmd_node pgroup_node = {
PGROUP_NODE,
- "%s(paging-group)#",
+ "%s(config-nat-paging-group)# ",
1,
};
@@ -1042,6 +1042,8 @@
install_element(NAT_NODE, &cfg_nat_no_pgroup_cmd);
install_node(&pgroup_node, config_write_pgroup);
install_default(PGROUP_NODE);
+ install_element(PGROUP_NODE, &ournode_exit_cmd);
+ install_element(PGROUP_NODE, &ournode_end_cmd);
install_element(PGROUP_NODE, &cfg_pgroup_lac_cmd);
install_element(PGROUP_NODE, &cfg_pgroup_no_lac_cmd);