aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/otputil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/otputil.c')
-rw-r--r--src/otputil.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/otputil.c b/src/otputil.c
index 8528010..7df9045 100644
--- a/src/otputil.c
+++ b/src/otputil.c
@@ -117,6 +117,11 @@ otputil_widget_lookup(
117#pragma mark widgets prototypes 117#pragma mark widgets prototypes
118 118
119static int 119static int
120otputil_widget_debug(
121 otputil_config_t * cnf );
122
123
124static int
120otputil_widget_usage( 125otputil_widget_usage(
121 otputil_config_t * cnf ); 126 otputil_config_t * cnf );
122 127
@@ -137,6 +142,18 @@ otputil_widget_version(
137#pragma mark otputil_widget_map[] 142#pragma mark otputil_widget_map[]
138static otputil_widget_t otputil_widget_map[] = 143static otputil_widget_t otputil_widget_map[] =
139{ 144{
145#ifdef USE_DEBUG
146 { .name = "debug",
147 .desc = NULL,
148 .usage = NULL,
149 .short_opt = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
150 .arg_min = 0,
151 .arg_max = 4096,
152 .aliases = NULL,
153 .func_exec = &otputil_widget_debug,
154 .func_usage = NULL,
155 },
156#endif
140 { .name = "help", 157 { .name = "help",
141 .desc = "display help", 158 .desc = "display help",
142 .usage = NULL, 159 .usage = NULL,
@@ -550,6 +567,27 @@ otputil_widget_lookup(
550//-------------------// 567//-------------------//
551#pragma mark widgets functions 568#pragma mark widgets functions
552 569
570int
571otputil_widget_debug(
572 otputil_config_t * cnf )
573{
574 int rc;
575 int pos;
576
577 // initial processing of cli arguments
578 if ((rc = otputil_arguments(cnf, cnf->argc, cnf->argv)) != 0)
579 return((rc == -1) ? 0 : 1);
580 if (optind != cnf->argc)
581 {
582 printf("Arguments:\n");
583 for(pos = optind; (pos < cnf->argc); pos++)
584 printf(" %2i: \"%s\"\n", pos, cnf->argv[pos]);
585 };
586
587 return(0);
588}
589
590
553/// displays usage information 591/// displays usage information
554int 592int
555otputil_widget_usage( 593otputil_widget_usage(