From 67d66e73d233e156aa7dddab2d56c0bb2211c02e Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 25 Aug 2021 15:44:03 +0200 Subject: Structured the commands and environment variables --- src/router/main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/router/main.c') diff --git a/src/router/main.c b/src/router/main.c index 82eeee3..eaf2d95 100644 --- a/src/router/main.c +++ b/src/router/main.c @@ -32,6 +32,7 @@ #include "audio.h" #include "display.h" +int show_help = 0; int num_kanal = 1; static osmo_cc_endpoint_t *cc_ep1 = NULL, *cc_ep2 = NULL; @@ -85,9 +86,8 @@ static int handle_options(int short_option, int argi, char **argv) switch (short_option) { case 'h': - print_usage(argv[0]); - print_help(); - return 0; + show_help = 1; + break; case 'v': if (!strcasecmp(argv[argi], "list")) { debug_list_cat(); @@ -182,6 +182,19 @@ int main(int argc, char *argv[]) argi = options_command_line(argc, argv, handle_options); if (argi <= 0) return argi; + if (show_help) { + if (argi < argc) { + routing_help(argv[argi]); + return 0; + } + print_usage(argv[0]); + print_help(); + printf("\n"); + env_help(); + printf("\n"); + routing_help(NULL); + return 0; + } /* init osmo-cc endpoint */ cc_ep1 = calloc(1, sizeof(*cc_ep1)); -- cgit v1.2.3