diff --git a/tests/ampctl.c b/tests/ampctl.c index 6a0cf29b3..4f4af3b9f 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -160,32 +160,14 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - amp_file = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -195,12 +177,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -217,12 +193,6 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (strlen(optarg) > 1) { send_cmd_term = strtol(optarg, NULL, 0); diff --git a/tests/ampctld.c b/tests/ampctld.c index 079eb068b..bf065a257 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -203,32 +203,14 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - amp_file = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -238,12 +220,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -260,22 +236,10 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - portno = optarg; break; case 'T': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - src_addr = optarg; break; diff --git a/tests/rigctl.c b/tests/rigctl.c index 35d1241b3..98e737afc 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -276,52 +276,22 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; case 'd': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - dcd_file = optarg; break; case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; @@ -363,12 +333,6 @@ int main(int argc, char *argv[]) break; case 'D': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { dcd_type = RIG_DCD_RIG; @@ -414,22 +378,10 @@ int main(int argc, char *argv[]) break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (strlen(optarg) > 1) { send_cmd_term = strtol(optarg, NULL, 0); @@ -442,12 +394,6 @@ int main(int argc, char *argv[]) break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -457,12 +403,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index e7b8fbf07..63ec30d8c 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -258,63 +258,27 @@ int main(int argc, char *argv[]) break; case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'R': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file2 = optarg; break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; case 'd': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - dcd_file = optarg; break; case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; @@ -347,12 +311,6 @@ int main(int argc, char *argv[]) break; case 'D': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { dcd_type = RIG_DCD_RIG; @@ -385,22 +343,10 @@ int main(int argc, char *argv[]) break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -410,23 +356,11 @@ int main(int argc, char *argv[]) break; case 'S': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - serial_rate2 = atoi(optarg); break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); diff --git a/tests/rigctld.c b/tests/rigctld.c index 8ee613cf1..09cf3fb29 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -334,52 +334,22 @@ int main(int argc, char *argv[]) break; case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; case 'd': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - dcd_file = optarg; break; case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; @@ -421,12 +391,6 @@ int main(int argc, char *argv[]) break; case 'D': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { dcd_type = RIG_DCD_RIG; @@ -472,33 +436,15 @@ int main(int argc, char *argv[]) break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 'S': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - resp_sep = *optarg; rig_debug(RIG_DEBUG_VERBOSE, "%s: resp_sep=%c\n", __func__, resp_sep); break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -508,12 +454,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (strcmp(optarg, "auto_power_on=0") == 0) { rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__); @@ -540,22 +480,10 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - portno = optarg; break; case 'T': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - src_addr = optarg; break; @@ -581,24 +509,12 @@ int main(int argc, char *argv[]) break; case 'W': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - twiddle_timeout = atoi(optarg); fprintf(stderr, "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n"); break; case 'w': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - twiddle_rit = atoi(optarg); fprintf(stderr, "twiddle_rit is deprecated...use e.g. --set-conf=twiddle_rit=1\n"); @@ -606,12 +522,6 @@ int main(int argc, char *argv[]) case 'x': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - uplink = atoi(optarg); break; diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c index a576b3af2..ce1a4a896 100644 --- a/tests/rigctlsync.c +++ b/tests/rigctlsync.c @@ -254,12 +254,6 @@ int main(int argc, char *argv[]) case 'm': case 'M': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (c == 'm') { my_model[0] = atoi(optarg); @@ -272,22 +266,10 @@ int main(int argc, char *argv[]) break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'R': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file2 = optarg; break; @@ -295,12 +277,6 @@ int main(int argc, char *argv[]) #if 0 case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; #endif @@ -308,12 +284,6 @@ int main(int argc, char *argv[]) #if 0 case 'd': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - dcd_file = optarg; break; #endif @@ -321,12 +291,6 @@ int main(int argc, char *argv[]) #if 0 case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; @@ -362,12 +326,6 @@ int main(int argc, char *argv[]) #if 0 case 'D': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { dcd_type = RIG_DCD_RIG; @@ -401,22 +359,10 @@ int main(int argc, char *argv[]) #endif case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -426,23 +372,11 @@ int main(int argc, char *argv[]) break; case 'S': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - serial_rate2 = atoi(optarg); break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index cf3a921d4..0450f1835 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -331,52 +331,22 @@ int main(int argc, char *argv[]) break; case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; case 'd': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - dcd_file = optarg; break; case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; @@ -418,12 +388,6 @@ int main(int argc, char *argv[]) break; case 'D': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { dcd_type = RIG_DCD_RIG; @@ -469,33 +433,15 @@ int main(int argc, char *argv[]) break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 'S': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - resp_sep = *optarg; rig_debug(RIG_DEBUG_VERBOSE, "%s: resp_sep=%c\n", __func__, resp_sep); break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -505,12 +451,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -527,22 +467,10 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - portno = optarg; break; case 'T': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - src_addr = optarg; break; @@ -568,24 +496,12 @@ int main(int argc, char *argv[]) break; case 'W': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - twiddle_timeout = atoi(optarg); fprintf(stderr, "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n"); break; case 'w': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - twiddle_rit = atoi(optarg); fprintf(stderr, "twiddle_rit is deprecated...use e.g. --set-conf=twiddle_rit=1\n"); @@ -593,12 +509,6 @@ int main(int argc, char *argv[]) case 'x': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - uplink = atoi(optarg); break; @@ -608,22 +518,10 @@ int main(int argc, char *argv[]) break; case 'M': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - multicast_addr = optarg; break; case 'n': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - multicast_port = atoi(optarg); if (multicast_port == 0) diff --git a/tests/rigmem.c b/tests/rigmem.c index bf73e7102..5f134b467 100644 --- a/tests/rigmem.c +++ b/tests/rigmem.c @@ -128,42 +128,18 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -173,12 +149,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -195,12 +165,6 @@ int main(int argc, char *argv[]) break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - csv_sep = optarg[0]; break; diff --git a/tests/rigsmtr.c b/tests/rigsmtr.c index aae17d2ec..88ac36bf4 100644 --- a/tests/rigsmtr.c +++ b/tests/rigsmtr.c @@ -113,42 +113,18 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -158,12 +134,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*rig_conf_parms != '\0') { strcat(rig_conf_parms, ","); @@ -180,42 +150,18 @@ int main(int argc, char *argv[]) break; case 'M': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_model = atoi(optarg); break; case 'R': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_file = optarg; break; case 'S': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_serial_rate = atoi(optarg); break; case 'N': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*rot_conf_parms != '\0') { strcat(rot_conf_parms, ","); diff --git a/tests/rigswr.c b/tests/rigswr.c index 0caf9bb22..86ce8aa7a 100644 --- a/tests/rigswr.c +++ b/tests/rigswr.c @@ -103,42 +103,18 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rig_file = optarg; break; case 'c': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - civaddr = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -148,12 +124,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -170,22 +140,10 @@ int main(int argc, char *argv[]) break; case 'p': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - ptt_file = optarg; break; case 'P': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (!strcmp(optarg, "RIG")) { ptt_type = RIG_PTT_RIG; diff --git a/tests/rotctl.c b/tests/rotctl.c index 873c9b96e..ac874818d 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -168,42 +168,18 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_file = optarg; break; case 'R': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_file2 = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -213,12 +189,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -235,12 +205,6 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (strlen(optarg) > 1) { send_cmd_term = strtol(optarg, NULL, 0); @@ -253,22 +217,10 @@ int main(int argc, char *argv[]) break; case 'o': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - az_offset = atof(optarg); break; case 'O': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - el_offset = atof(optarg); break; diff --git a/tests/rotctld.c b/tests/rotctld.c index e68227acf..ce6d1a101 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -196,42 +196,18 @@ int main(int argc, char *argv[]) exit(0); case 'm': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - my_model = atoi(optarg); break; case 'r': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_file = optarg; break; case 'R': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - rot_file2 = optarg; break; case 's': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) { fprintf(stderr, "Invalid baud rate of %s\n", optarg); @@ -241,12 +217,6 @@ int main(int argc, char *argv[]) break; case 'C': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - if (*conf_parms != '\0') { strcat(conf_parms, ","); @@ -263,42 +233,18 @@ int main(int argc, char *argv[]) break; case 't': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - portno = optarg; break; case 'T': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - src_addr = optarg; break; case 'o': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - az_offset = atof(optarg); break; case 'O': - if (!optarg) - { - usage(); /* wrong arg count */ - exit(1); - } - el_offset = atof(optarg); case 'v':