aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-10-09 20:41:17 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2020-10-09 20:42:16 +0200
commit08c5037d601355f0d2441d62012945383d344fe8 (patch)
tree9f9e3dc5be1b997687d1aa3d04efdfb99e862735
parent781f04a8f8be26ad7589a950c688f54047f798ee (diff)
pcu_main: add commandline option --vty-ref-xml
The commandline option --vty-ref-xml is needed to enable automatic generation of the VTY reference manual. Change-Id: Ie1829a06b83f69f4cd8256adbf9437388ca3d7e0 Related: SYS#4937, OS#1601
-rw-r--r--src/pcu_main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index d0e630fc..77c46dd9 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -82,6 +82,7 @@ static void print_help()
" -D --daemonize Fork the process into a background "
"daemon\n"
" -i --gsmtap-ip The destination IP used for GSMTAP\n"
+ " --vty-ref-xml Generate the VTY reference XML output and exit.\n"
);
}
@@ -90,6 +91,7 @@ static void handle_options(int argc, char **argv)
{
while (1) {
int option_idx = 0, c;
+ static int long_option = 0;
static const struct option long_options[] = {
{ "help", 0, 0, 'h' },
{ "config-file", 1, 0, 'c' },
@@ -100,6 +102,7 @@ static void handle_options(int argc, char **argv)
{ "daemonize", 0, 0, 'D' },
{ "exit", 0, 0, 'e' },
{ "gsmtap-ip", 1, 0, 'i' },
+ { "vty-ref-xml", 0, &long_option, 1 },
{ 0, 0, 0, 0 }
};
@@ -113,6 +116,15 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
break;
+ case 0:
+ switch (long_option) {
+ case 1:
+ vty_dump_xml_ref(stdout);
+ exit(0);
+ default:
+ fprintf(stderr, "error parsing cmdline options\n");
+ exit(2);
+ }
case 'c':
free(config_file);
config_file = strdup(optarg);