aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ttu/tinytacutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ttu/tinytacutil.c')
-rw-r--r--src/ttu/tinytacutil.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ttu/tinytacutil.c b/src/ttu/tinytacutil.c
index a122f50..4287eb1 100644
--- a/src/ttu/tinytacutil.c
+++ b/src/ttu/tinytacutil.c
@@ -120,10 +120,11 @@ int main(int argc, char * argv[])
120{ 120{
121 int c; 121 int c;
122 int rc; 122 int rc;
123 int opt;
123 int opt_index; 124 int opt_index;
124 125
125 // getopt options 126 // getopt options
126 static char short_opt[] = "hVvq"; 127 static char short_opt[] = "46dhVvq";
127 static struct option long_opt[] = 128 static struct option long_opt[] =
128 { 129 {
129 {"help", no_argument, NULL, 'h' }, 130 {"help", no_argument, NULL, 'h' },
@@ -148,12 +149,25 @@ int main(int argc, char * argv[])
148 case 0: /* long options toggles */ 149 case 0: /* long options toggles */
149 break; 150 break;
150 151
152 case '4':
153 opt = TTAC_YES; tinytac_set_option(NULL, TTAC_OPT_IPV4, &opt);
154 opt = TTAC_NO; tinytac_set_option(NULL, TTAC_OPT_IPV6, &opt);
155 break;
156
157 case '6':
158 opt = TTAC_YES; tinytac_set_option(NULL, TTAC_OPT_IPV6, &opt);
159 opt = TTAC_NO; tinytac_set_option(NULL, TTAC_OPT_IPV4, &opt);
160 break;
161
151 case 'd': 162 case 'd':
163 opt = TTAC_DEBUG_ANY; tinytac_set_option(NULL, TTAC_OPT_DEBUG_LEVEL, &opt);
152 break; 164 break;
153 165
154 case 'h': 166 case 'h':
155 printf("Usage: %s [OPTIONS]\n", PROGRAM_NAME); 167 printf("Usage: %s [OPTIONS]\n", PROGRAM_NAME);
156 printf("OPTIONS:\n"); 168 printf("OPTIONS:\n");
169 printf(" -4 use IPv4\n");
170 printf(" -6 use IPv6\n");
157 printf(" -d, --debug print debug messages\n"); 171 printf(" -d, --debug print debug messages\n");
158 printf(" -h, --help print this help and exit\n"); 172 printf(" -h, --help print this help and exit\n");
159 printf(" -q, --quiet, --silent do not print messages\n"); 173 printf(" -q, --quiet, --silent do not print messages\n");