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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tru/tinyradutil.c b/src/tru/tinyradutil.c
index b5c709e..6a77ec4 100644
--- a/src/tru/tinyradutil.c
+++ b/src/tru/tinyradutil.c
@@ -176,7 +176,7 @@ int main(int argc, char * argv[])
176 if (!(cnf->widget)) 176 if (!(cnf->widget))
177 { 177 {
178 // process common cli options 178 // process common cli options
179 if ((rc = tru_cli_parse(cnf, argc, argv, short_opt, long_opt)) != 0) 179 if ((rc = tru_cli_parse(cnf, argc, argv, short_opt, long_opt, &tru_usage)) != 0)
180 { 180 {
181 tru_cleanup(cnf); 181 tru_cleanup(cnf);
182 return((rc == 0) ? 0 : 1); 182 return((rc == 0) ? 0 : 1);
@@ -299,7 +299,8 @@ tru_cli_parse(
299 int argc, 299 int argc,
300 char * const * argv, 300 char * const * argv,
301 const char * short_opt, 301 const char * short_opt,
302 const struct option * long_opt ) 302 const struct option * long_opt,
303 int (*usage_func)(TinyRadUtilConf * cnf, const char * short_opt ) )
303{ 304{
304 int c; 305 int c;
305 int opt_index; 306 int opt_index;
@@ -323,7 +324,7 @@ tru_cli_parse(
323 return(TRU_GETOPT_ERROR); 324 return(TRU_GETOPT_ERROR);
324 325
325 case 'h': 326 case 'h':
326 tru_usage(cnf, short_opt); 327 usage_func(cnf, short_opt);
327 return(TRU_GETOPT_EXIT); 328 return(TRU_GETOPT_EXIT);
328 329
329 case '?': 330 case '?':