aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/main.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-10-09 20:34:35 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2020-10-09 20:36:01 +0200
commita73c6d67859043d68eff8410e912ee3e71163048 (patch)
tree2bd4b525fbbdf078149acb2fe92a5ba226f784da /src/common/main.c
parent6710438899c49f9584b01baf816e6be71c600797 (diff)
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: I895db6086748a5916874e779963caed589050109 Related: SYS#4937, OS#1601
Diffstat (limited to 'src/common/main.c')
-rw-r--r--src/common/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/main.c b/src/common/main.c
index dfdc2a74..9f09d31a 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -77,6 +77,7 @@ static void print_help()
" -e --log-level Set a global log-level\n"
" -r --realtime PRIO Use SCHED_RR with the specified priority (deprecated, use VTY instead)\n"
" -i --gsmtap-ip The destination IP used for GSMTAP.\n"
+ " --vty-ref-xml Generate the VTY reference XML output and exit.\n"
);
bts_model_print_help();
}
@@ -95,6 +96,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[] = {
/* FIXME: all those are generic Osmocom app options */
{ "help", 0, 0, 'h' },
@@ -109,6 +111,7 @@ static void handle_options(int argc, char **argv)
{ "gsmtap-ip", 1, 0, 'i' },
{ "trx-num", 1, 0, 't' },
{ "realtime", 1, 0, 'r' },
+ {"vty-ref-xml", 0, &long_option, 1},
{ 0, 0, 0, 0 }
};
@@ -122,6 +125,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 's':
log_set_use_color(osmo_stderr_target, 0);
break;