aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tru/widget-dict.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tru/widget-dict.c')
-rw-r--r--src/tru/widget-dict.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tru/widget-dict.c b/src/tru/widget-dict.c
index 793f308..8318af4 100644
--- a/src/tru/widget-dict.c
+++ b/src/tru/widget-dict.c
@@ -56,11 +56,29 @@ tru_widget_dict(
56{ 56{
57 int rc; 57 int rc;
58 TinyRadDict * dict; 58 TinyRadDict * dict;
59
60 // getopt options
61 static char short_opt[] = TRU_COMMON_SHORT TRU_DICT_SHORT;
62 static struct option long_opt[] = { TRU_DICT_LONG TRU_COMMON_LONG };
63
64 // process widget cli options
65 if ((rc = tru_cli_parse(cnf, cnf->argc, cnf->argv, short_opt, long_opt)) != 0)
66 {
67 return((rc == 0) ? 0 : 1);
68 };
69 if (optind < cnf->argc)
70 {
71 fprintf(stderr, "%s: unrecognized argument `-- %s'\n", PROGRAM_NAME, cnf->argv[optind+1]);
72 fprintf(stderr, "Try `%s %s --help' for more information.\n", PROGRAM_NAME, cnf->widget_name);
73 return(1);
74 };
75
59 if ((rc = tru_load_tinyrad(cnf)) != TRAD_SUCCESS) 76 if ((rc = tru_load_tinyrad(cnf)) != TRAD_SUCCESS)
60 return(rc); 77 return(rc);
61 tinyrad_get_option(cnf->tr, TRAD_OPT_DICTIONARY, &dict); 78 tinyrad_get_option(cnf->tr, TRAD_OPT_DICTIONARY, &dict);
62 tinyrad_dict_print(dict, 0xffff); 79 tinyrad_dict_print(dict, 0xffff);
63 tinyrad_free(dict); 80 tinyrad_free(dict);
81
64 return(TRAD_SUCCESS); 82 return(TRAD_SUCCESS);
65} 83}
66 84