[Spread-users] [PATCH] Correct names of spmonitor, spuser, and spflooder binaries in usage output

Jonathan Stanton jonathan at cnds.jhu.edu
Fri Apr 16 13:59:47 EDT 2004


I applied your patch. 

Jonathan

On Tue, Apr 13, 2004 at 07:38:33PM -0700, Daniel L. Rall wrote:
> Currently, the binaries neglect to include the "sp" prefix recently 
> introduced at the beginning of their names when referencing themselves in 
> commandline feedback.  Here's an example using spmonitor:
> 
> Usage: monitor
>         [-p <port number>]: specify port number
>         [-n <proc name>]  : force computer name
>         [-t <status timeout>]: specify number of seconds between status 
>         queries
>         [-c <file name>]  : specify configuration file
> 
> 
> Attached is a patch adding the new "sp" prefix.  Here's the associated 
> change log message:
> 
> * daemon/flooder.c
> * daemon/monitor.c
> * daemon/user.c
>   Include "sp" prefix on binary names when outputing usage information.
> 
> 
> Now, the Right Way to do this is to either 1) parse the binary name off of 
> argv[0] or 2) generate a #define via autoconf which sets the binary name.  
> A combined approach of #1 with a fallback to #2 is probably preferable.
> 
> Thanks, Dan

> Index: daemon/monitor.c
> ===================================================================
> RCS file: /storage/cvsroot/spread/daemon/monitor.c,v
> retrieving revision 1.12
> diff -u -r1.12 monitor.c
> --- daemon/monitor.c	5 Mar 2004 00:32:46 -0000	1.12
> +++ daemon/monitor.c	14 Apr 2004 02:34:00 -0000
> @@ -814,7 +814,7 @@
>  
>  			argc--; argv++;
>  		}else{
> -			Alarm( EXIT, "Usage: monitor\n%s\n%s\n%s\n%s\n",
> +			Alarm( EXIT, "Usage: spmonitor\n%s\n%s\n%s\n%s\n",
>  				"\t[-p <port number>]: specify port number",
>  				"\t[-n <proc name>]  : force computer name",
>  				"\t[-t <status timeout>]: specify number of seconds between status queries",
> Index: daemon/user.c
> ===================================================================
> RCS file: /storage/cvsroot/spread/daemon/user.c,v
> retrieving revision 1.6
> diff -u -r1.6 user.c
> --- daemon/user.c	5 Mar 2004 00:32:46 -0000	1.6
> +++ daemon/user.c	14 Apr 2004 02:34:00 -0000
> @@ -511,7 +511,7 @@
>  }
>  static  void    Print_help()
>  {
> -    printf( "Usage: user\n%s\n%s\n%s\n%s\n%s\n",
> +    printf( "Usage: spuser\n%s\n%s\n%s\n%s\n%s\n",
>              "\t[-u <user name>]  : unique (in this machine) user name",
>              "\t[-s <address>]    : either port or port at machine",
>              "\t[-n <username>]    : username for authentication",
> Index: daemon/flooder.c
> ===================================================================
> RCS file: /storage/cvsroot/spread/daemon/flooder.c,v
> retrieving revision 1.5
> diff -u -r1.5 flooder.c
> --- daemon/flooder.c	5 Mar 2004 00:32:46 -0000	1.5
> +++ daemon/flooder.c	14 Apr 2004 02:34:00 -0000
> @@ -184,7 +184,7 @@
>  }
>  static  void    Print_help()
>  {
> -    printf( "Usage: flooder\n%s\n%s\n%s\n%s\n%s\n%s\n",
> +    printf( "Usage: spflooder\n%s\n%s\n%s\n%s\n%s\n%s\n",
>              "\t[-u <user name>]     : unique (in this machine) user name",
>              "\t[-m <num messages>]  : number of messages",
>              "\t[-b <num bytes>]     : number of bytes per message 1-100,000",


-- 
-------------------------------------------------------
Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    
-------------------------------------------------------




More information about the Spread-users mailing list