aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2022-03-31 13:17:02 -0800
committerDavid M. Syzdek <david@syzdek.net>2022-03-31 13:17:02 -0800
commited6f70753a49e62807bb0d8f5765c9075eacf55a (patch)
tree953705668da55e6ea95140c8cb5bffbd1c48efd8 /src
parente27a69b258f4ff3d0fefa214e8507a93e4c5c133 (diff)
downloadtinyrad-ed6f70753a49e62807bb0d8f5765c9075eacf55a.tar.gz
tinyrad-ed6f70753a49e62807bb0d8f5765c9075eacf55a.tar.bz2
tinyrad-ed6f70753a49e62807bb0d8f5765c9075eacf55a.tar.xz
tinyrad-ed6f70753a49e62807bb0d8f5765c9075eacf55a.zip
tinyrad: adding --dry-run option
Diffstat (limited to 'src')
-rw-r--r--src/tru/tinyradutil.c5
-rw-r--r--src/tru/tinyradutil.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/tru/tinyradutil.c b/src/tru/tinyradutil.c
index b07492a..ec627d7 100644
--- a/src/tru/tinyradutil.c
+++ b/src/tru/tinyradutil.c
@@ -460,6 +460,10 @@ tru_getopt(
460 }; 460 };
461 return(TRU_GETOPT_MATCHED); 461 return(TRU_GETOPT_MATCHED);
462 462
463 case 'n':
464 cnf->opts |= TRU_OPT_DRY_RUN;
465 return(TRU_GETOPT_MATCHED);
466
463 case 'q': 467 case 'q':
464 cnf->opts |= TRUTILS_OPT_QUIET; 468 cnf->opts |= TRUTILS_OPT_QUIET;
465 cnf->opts &= ~TRUTILS_OPT_VERBOSE; 469 cnf->opts &= ~TRUTILS_OPT_VERBOSE;
@@ -529,6 +533,7 @@ tru_usage_options(
529 if ((strchr(s, 'H'))) printf(" -H uri RADIUS URI\n"); 533 if ((strchr(s, 'H'))) printf(" -H uri RADIUS URI\n");
530 if ((strchr(s, 'h'))) printf(" -h, --help print this help and exit\n"); 534 if ((strchr(s, 'h'))) printf(" -h, --help print this help and exit\n");
531 if ((strchr(s, 'I'))) printf(" -I path add path to dictionary search paths\n"); 535 if ((strchr(s, 'I'))) printf(" -I path add path to dictionary search paths\n");
536 if ((strchr(s, 'n'))) printf(" -n, --dry-run generate request without transmitting request\n");
532 if ((strchr(s, 'q'))) printf(" -q, --quiet, --silent do not print messages\n"); 537 if ((strchr(s, 'q'))) printf(" -q, --quiet, --silent do not print messages\n");
533 if ((strchr(s, 'r'))) printf(" -r, --resolve resolve URLs\n"); 538 if ((strchr(s, 'r'))) printf(" -r, --resolve resolve URLs\n");
534 if ((strchr(s, 'V'))) printf(" -V, --version print version number and exit\n"); 539 if ((strchr(s, 'V'))) printf(" -V, --version print version number and exit\n");
diff --git a/src/tru/tinyradutil.h b/src/tru/tinyradutil.h
index 156a07e..6bfda50 100644
--- a/src/tru/tinyradutil.h
+++ b/src/tru/tinyradutil.h
@@ -77,6 +77,7 @@
77 77
78 78
79#define TRU_OPT_RESOLVE 0x0001 79#define TRU_OPT_RESOLVE 0x0001
80#define TRU_OPT_DRY_RUN 0x0002
80 81
81 82
82#define TRU_COMMON_SHORT "d:hqVv" 83#define TRU_COMMON_SHORT "d:hqVv"
@@ -101,8 +102,9 @@
101 { "ipv6", no_argument, NULL, '6' }, \ 102 { "ipv6", no_argument, NULL, '6' }, \
102 103
103 104
104#define TRU_REQ_SHORT "f:" 105#define TRU_REQ_SHORT "f:n"
105#define TRU_REQ_LONG \ 106#define TRU_REQ_LONG \
107 { "dry-run", no_argument, NULL, 'n' }, \
106 { "file", optional_argument, NULL, 'f' }, \ 108 { "file", optional_argument, NULL, 'f' }, \
107 109
108 110