@@ -114,7 +114,7 @@ static struct option long_options[] =
114114 {0 , 0 , 0 , 0 }
115115};
116116
117- void usage ();
117+ void usage (FILE * fout );
118118static int handle_ts2000 (void * arg );
119119
120120static RIG * my_rig ; /* handle to rig */
@@ -248,7 +248,7 @@ int main(int argc, char *argv[])
248248 switch (c )
249249 {
250250 case 'h' :
251- usage ();
251+ usage (stdout );
252252 exit (0 );
253253
254254 case 'V' :
@@ -400,7 +400,7 @@ int main(int argc, char *argv[])
400400 break ;
401401
402402 default :
403- usage (); /* unknown option? */
403+ usage (stderr ); /* unknown option? */
404404 exit (1 );
405405 }
406406 }
@@ -411,7 +411,7 @@ int main(int argc, char *argv[])
411411
412412 if (argc == 1 )
413413 {
414- usage ();
414+ usage (stderr );
415415 exit (1 );
416416 }
417417
@@ -1690,20 +1690,21 @@ static int handle_ts2000(void *arg)
16901690}
16911691
16921692
1693- void usage ()
1693+ void usage (FILE * fout )
16941694{
16951695 char * name = "rigctlcom" ;
1696- printf ("Usage: %s -m rignumber -r comport -s baud -R comport [OPTIONS]...\n\n"
1696+
1697+ fprintf (fout , "Usage: %s -m rignumber -r comport -s baud -R comport [OPTIONS]...\n\n"
16971698 "A TS-2000 emulator for rig sharing with programs that don't support Hamlib or FLRig to be able\n"
16981699 "to use a connected radio transceiver or receiver with FLRig or rigctld via Hamlib.\n\n" ,
16991700 name );
17001701
1701- printf ( "Example: Using FLRig with virtual COM5/COM6 and other program:\n" );
1702- printf ( "\t%s -m 4 -R COM5 -S 115200\n\n" , name );
1703- printf ( "Other program would connect to COM6 and use TS-2000 115200 8N1\n\n" );
1704- printf ( "See the %s.1 manual page for complete details.\n\n" , name );
1702+ fprintf ( fout , "Example: Using FLRig with virtual COM5/COM6 and other program:\n" );
1703+ fprintf ( fout , "\t%s -m 4 -R COM5 -S 115200\n\n" , name );
1704+ fprintf ( fout , "Other program would connect to COM6 and use TS-2000 115200 8N1\n\n" );
1705+ fprintf ( fout , "See the %s.1 manual page for complete details.\n\n" , name );
17051706
1706- printf (
1707+ fprintf ( fout ,
17071708 " -m, --model=ID select radio model number. See model list (-l)\n"
17081709 " -r, --rig-file=DEVICE set device of the radio to operate on\n"
17091710 " -R, --rig-file2=DEVICE set device of the virtual com port to operate on\n"
@@ -1725,6 +1726,5 @@ void usage()
17251726 " -V, --version output version information and exit\n\n"
17261727 );
17271728
1728- printf ("\nReport bugs to <hamlib-developer@lists.sourceforge.net>.\n" );
1729-
1729+ fprintf (fout , "\nReport bugs to <hamlib-developer@lists.sourceforge.net>.\n" );
17301730}
0 commit comments