From 8edf99fc187b7b462fa297d885cda89b172bb5d3 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Wed, 25 Dec 2024 16:36:37 -0600 Subject: [PATCH] Change skipinit so skip-init for consistency And now ignores the skip-init on the non-interactive rigctl --- doc/man1/rigctl.1 | 2 +- tests/rigctl.c | 4 ++-- tests/rigctl_parse.c | 12 +++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index b318f3fc3..7c0dadc8e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -334,7 +334,7 @@ and exit. Sets the cookie to be used for remote access security . .TP -.BR \-# ", " \-\-skipinit +.BR \-# ", " \-\-skip_init Skips most startup intialization. This is now automatically done when any commands are on the line. . .TP diff --git a/tests/rigctl.c b/tests/rigctl.c index 75b41a14d..5a40b3e11 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -110,7 +110,7 @@ static struct option long_options[] = {"help", 0, 0, 'h'}, {"version", 0, 0, 'V'}, {"cookie", 0, 0, '!'}, - {"skipinit", 0, 0, '#'}, + {"skip-init", 0, 0, '#'}, {0, 0, 0, 0} }; @@ -956,7 +956,7 @@ void usage(void) " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" " -!, --cookie use cookie control\n" - " -#, --skipinit skips rig initialization\n\n" + " -#, --skip-init skips rig initialization\n\n" ); usage_rig(stdout); diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index ebe9df723..263a7bad8 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -915,11 +915,21 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, } } + if (strcmp(command,"skip-init")==0) + { + // no-op now since it's automatic in non-interactive mode + return(RIG_OK); + } + cmd_entry = find_cmd_entry(cmd); if (!cmd_entry) { - if (cmd != ' ') + if (cmd == 0) + { + fprintf(stderr, "Command '%s' not found!\n", command); + } + else if (cmd != ' ') { fprintf(stderr, "Command '%c' not found!\n", cmd); }