Change in osmo-bts[master]: main: add commandline option --vty-ref-xml

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Fri Oct 9 18:36:19 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20524 )


Change subject: main: add commandline option --vty-ref-xml
......................................................................

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
---
M src/common/main.c
1 file changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/20524/1

diff --git a/src/common/main.c b/src/common/main.c
index dfdc2a7..9f09d31 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -77,6 +77,7 @@
 		"  -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 @@
 
 	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 @@
 			{ "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 @@
 			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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20524
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I895db6086748a5916874e779963caed589050109
Gerrit-Change-Number: 20524
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201009/4ecd7c3f/attachment.htm>


More information about the gerrit-log mailing list