aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tru/tinyradutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tru/tinyradutil.c')
-rw-r--r--src/tru/tinyradutil.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tru/tinyradutil.c b/src/tru/tinyradutil.c
index 6a77ec4..5acfd7b 100644
--- a/src/tru/tinyradutil.c
+++ b/src/tru/tinyradutil.c
@@ -127,6 +127,13 @@ const TinyRadUtilWidget tru_widget_map[] =
127 .func = &tru_widget_dict 127 .func = &tru_widget_dict
128 }, 128 },
129 { 129 {
130 .name = "url",
131 .desc = "process TinyRad URL",
132 .usage = NULL,
133 .aliases = (const char * const[]) { TRU_PREFIX"-url", NULL },
134 .func = &tru_widget_url
135 },
136 {
130 .name = NULL, 137 .name = NULL,
131 .func = NULL, 138 .func = NULL,
132 .usage = NULL, 139 .usage = NULL,
@@ -356,6 +363,14 @@ tru_getopt(
356 363
357 switch(c = getopt_long(argc, argv, short_opt, long_opt, opt_index)) 364 switch(c = getopt_long(argc, argv, short_opt, long_opt, opt_index))
358 { 365 {
366 case '4':
367 cnf->tr_opts |= TRAD_IPV4;
368 return(TRU_GETOPT_MATCHED);
369
370 case '6':
371 cnf->tr_opts |= TRAD_IPV6;
372 return(TRU_GETOPT_MATCHED);
373
359 case 'b': 374 case 'b':
360 cnf->tr_opts |= TRAD_BUILTIN_DICT; 375 cnf->tr_opts |= TRAD_BUILTIN_DICT;
361 return(TRU_GETOPT_MATCHED); 376 return(TRU_GETOPT_MATCHED);
@@ -386,6 +401,10 @@ tru_getopt(
386 cnf->opts &= ~TRUTILS_OPT_VERBOSE; 401 cnf->opts &= ~TRUTILS_OPT_VERBOSE;
387 return(TRU_GETOPT_MATCHED); 402 return(TRU_GETOPT_MATCHED);
388 403
404 case 'r':
405 cnf->opts |= TRU_OPT_RESOLVE;
406 return(TRU_GETOPT_MATCHED);
407
389 case 'V': 408 case 'V':
390 trutils_version(); 409 trutils_version();
391 return(TRU_GETOPT_EXIT); 410 return(TRU_GETOPT_EXIT);
@@ -448,6 +467,8 @@ tru_usage_options(
448 s = short_opt; 467 s = short_opt;
449 468
450 printf("OPTIONS:\n"); 469 printf("OPTIONS:\n");
470 if ((strchr(s, '4'))) printf(" -4 use IPv4 addresses\n");
471 if ((strchr(s, '6'))) printf(" -6 use IPv6 addresses\n");
451 if ((strchr(s, 'b'))) printf(" -b, --builtin-dict load built-in dictionary\n"); 472 if ((strchr(s, 'b'))) printf(" -b, --builtin-dict load built-in dictionary\n");
452 if ((strchr(s, 'D'))) printf(" -D dictionary include dictionary\n"); 473 if ((strchr(s, 'D'))) printf(" -D dictionary include dictionary\n");
453 if ((strchr(s, 'd'))) printf(" -d level, --debug=level print debug messages\n"); 474 if ((strchr(s, 'd'))) printf(" -d level, --debug=level print debug messages\n");
@@ -455,6 +476,7 @@ tru_usage_options(
455 if ((strchr(s, 'h'))) printf(" -h, --help print this help and exit\n"); 476 if ((strchr(s, 'h'))) printf(" -h, --help print this help and exit\n");
456 if ((strchr(s, 'I'))) printf(" -I path add path to dictionary search paths\n"); 477 if ((strchr(s, 'I'))) printf(" -I path add path to dictionary search paths\n");
457 if ((strchr(s, 'q'))) printf(" -q, --quiet, --silent do not print messages\n"); 478 if ((strchr(s, 'q'))) printf(" -q, --quiet, --silent do not print messages\n");
479 if ((strchr(s, 'r'))) printf(" -r, --resolve resolve URLs\n");
458 if ((strchr(s, 'V'))) printf(" -V, --version print version number and exit\n"); 480 if ((strchr(s, 'V'))) printf(" -V, --version print version number and exit\n");
459 if ((strchr(s, 'v'))) printf(" -v, --verbose print verbose messages\n"); 481 if ((strchr(s, 'v'))) printf(" -v, --verbose print verbose messages\n");
460 482