]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
src/tlsproxy.c: Display value of invalid options.
authorSimon Ruderich <simon@ruderich.org>
Sun, 11 Mar 2012 22:06:09 +0000 (23:06 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sun, 11 Mar 2012 22:06:09 +0000 (23:06 +0100)
src/tlsproxy.c

index 86ee227e142a762a7bc8ca7ed8898829da9b5b32..54509f35f88b1668b4b1097a6221d1b8eec457b4 100644 (file)
@@ -105,7 +105,7 @@ int main(int argc, char **argv) {
     port = atoi(argv[argc - 1]);
     if (0 >= port || 0xffff < port) {
         print_usage(argv[0]);
-        fprintf(stderr, "\ninvalid port\n");
+        fprintf(stderr, "\ninvalid port: '%s'\n", argv[argc - 1]);
         return EXIT_FAILURE;
     }
 
@@ -277,7 +277,8 @@ static void parse_arguments(int argc, char **argv) {
             case 'd': {
                 if (0 > atoi(optarg)) {
                     print_usage(argv[0]);
-                    fprintf(stderr, "\n-d positive number required\n");
+                    fprintf(stderr, "\n-d positive number required: '%s'\n",
+                                    optarg);
                     exit(EXIT_FAILURE);
                 }
                 global_log_level = atoi(optarg);
@@ -293,7 +294,8 @@ static void parse_arguments(int argc, char **argv) {
                         || 0 >= atoi(position + 1)
                         || 0xffff < atoi(position + 1)) {
                     print_usage(argv[0]);
-                    fprintf(stderr, "\ninvalid -p, format host:port\n");
+                    fprintf(stderr, "\ninvalid -p: '%s', format host:port\n",
+                            optarg);
                     exit(EXIT_FAILURE);
                 }
 
@@ -317,7 +319,8 @@ static void parse_arguments(int argc, char **argv) {
             case 't': {
                 if (0 >= atoi(optarg)) {
                     print_usage(argv[0]);
-                    fprintf(stderr, "\n-t positive number required\n");
+                    fprintf(stderr, "\n-t positive number required: '%s'\n",
+                                    optarg);
                     exit(EXIT_FAILURE);
                 }
                 thread_count = (size_t)atoi(optarg);