Compare commits

...

2 Commits

Author SHA1 Message Date
Neels Hofmeyr
b53ea78009 manuals: generate vty reference xml at build time
Move 'doc' subdir further down to "make sure" the osmo-hlr binary is built
before the docs.

Remove hlr_vty_reference.xml from the source tree.

In manuals/Makefile.am use the new BUILT_REFERENCE_XML feature recently added
to osmo-gsm-manuals, and add a build target to generate the XML using the new
osmo-hlr --vty-ref-xml cmdline switch.

Depends: I613d692328050a036d05b49a436ab495fc2087ba (osmo-gsm-manuals)
Change-Id: I99e61274e2ceb2c1fe5fb05bb99e1ec19695ad92
2020-06-29 17:12:06 +02:00
Neels Hofmeyr
1b40a93031 add osmo-hlr --vty-ref-xml: dump VTY ref XML to stdout
Add only a long option to not clutter the cmdline namespace.

To add a long option without a short letter is slightly complex: use the 'flag'
and 'val' mechanism as in 'man 3 getopt' to write an option index to
long_option.

Depends: Ic74bbdb6dc5ea05f03c791cc70184861e39cd492 (libosmocore)
Change-Id: I554c1ba22f3734769d70c91d1606f545fcfdda6d
2020-06-29 17:12:06 +02:00
4 changed files with 18 additions and 1432 deletions

View File

@@ -1,11 +1,11 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2
SUBDIRS = \
doc \
src \
include \
sql \
contrib \
doc \
tests \
$(NULL)

View File

@@ -16,6 +16,11 @@ if BUILD_MANUALS
VTY_REFERENCE = osmohlr-vty-reference.xml
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
BUILT_REFERENCE_XML = $(builddir)/vty/hlr_vty_reference.xml
$(builddir)/vty/hlr_vty_reference.xml: $(top_builddir)/src/osmo-hlr
mkdir -p $(builddir)/vty
$(top_builddir)/src/osmo-hlr --vty-ref-xml > $@
OSMO_REPOSITORY = osmo-hlr
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
endif

File diff suppressed because it is too large Load Diff

View File

@@ -576,6 +576,7 @@ static void print_help()
printf(" -U --db-upgrade Allow HLR database schema upgrades.\n");
printf(" -C --db-check Quit after opening (and upgrading) the database.\n");
printf(" -V --version Print the version of OsmoHLR.\n");
printf(" --vty-ref-xml Generate the VTY reference XML output and exit.\n");
}
static struct {
@@ -595,6 +596,7 @@ static void handle_options(int argc, char **argv)
{
while (1) {
int option_index = 0, c;
static int long_option = 0;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"config-file", 1, 0, 'c'},
@@ -607,6 +609,7 @@ static void handle_options(int argc, char **argv)
{"db-upgrade", 0, 0, 'U' },
{"db-check", 0, 0, 'C' },
{"version", 0, 0, 'V' },
{"vty-ref-xml", 0, &long_option, 1},
{0, 0, 0, 0}
};
@@ -620,6 +623,15 @@ static void handle_options(int argc, char **argv)
print_usage();
print_help();
exit(0);
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':
cmdline_opts.config_file = optarg;
break;