aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/ttu/tinytacutil.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ttu/tinytacutil.c b/src/ttu/tinytacutil.c
index 2ff5a8e..d27679d 100644
--- a/src/ttu/tinytacutil.c
+++ b/src/ttu/tinytacutil.c
@@ -396,9 +396,10 @@ ttu_cli_arguments(
396 int opt; 396 int opt;
397 int ival; 397 int ival;
398 int rc; 398 int rc;
399 void * ptr;
399 400
400 // getopt options 401 // getopt options
401 static const char * short_opt = "+46a:dH:hVvqWw:y:"; 402 static const char * short_opt = "+46a:dH:hK:k:VvqWw:y:";
402 static struct option long_opt[] = 403 static struct option long_opt[] =
403 { 404 {
404 {"help", no_argument, NULL, 'h' }, 405 {"help", no_argument, NULL, 'h' },
@@ -462,6 +463,20 @@ ttu_cli_arguments(
462 ttu_usage(cnf); 463 ttu_usage(cnf);
463 return(-1); 464 return(-1);
464 465
466 case 'K':
467 if ((ptr = ttu_file2str(optarg)) == NULL)
468 return(ttu_error(cnf, 1, "%s: %s", optarg, strerror(errno)));
469 rc = tinytac_set_option(cnf->tt, TTAC_OPT_KEY, ptr);
470 free(ptr);
471 if (rc != TTAC_SUCCESS)
472 return(ttu_error(cnf, 1, "tinytac_set_option(TTAC_OPT_KEY): %s", tinytac_strerror(rc)));
473 break;
474
475 case 'k':
476 if ((rc = tinytac_set_option(cnf->tt, TTAC_OPT_KEY, optarg)) != TTAC_SUCCESS)
477 return(ttu_error(cnf, 1, "tinytac_set_option(TTAC_OPT_KEY): %s", tinytac_strerror(rc)));
478 break;
479
465 case 'q': 480 case 'q':
466 cnf->opts |= TTUTILS_OPT_QUIET; 481 cnf->opts |= TTUTILS_OPT_QUIET;
467 cnf->opts &= ~TTUTILS_OPT_VERBOSE; 482 cnf->opts &= ~TTUTILS_OPT_VERBOSE;