Subject: bin/26225: usage and manpage fixes for rdist(1)
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <hira@po6.nsk.ne.jp>
List: netbsd-bugs
Date: 07/10/2004 13:39:48
>Number:         26225
>Category:       bin
>Synopsis:       usage and manpage fixes for rdist(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 10 04:40:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Kouichirou Hiratsuka
>Release:        NetBSD 2.0G
>Organization:
>Environment:
System: NetBSD firefly.localdomain 2.0G NetBSD 2.0G (FIREFLY.MP) #20: Fri Jul 9 01:13:02 JST 2004 root@firefly.localdomain:/usr/src/sys/arch/i386/compile/FIREFLY.MP i386
Architecture: i386
Machine: i386
>Description:
	Usage and manpage of rdist(1) have follwing problems.
	* [login@] is missing in the usage
	* it outputs usage to stdout
	* options are not alphabetical order
	* it uses hardcoding program name

>How-To-Repeat:
	see usage and manpage

>Fix:
	* add [login@]
	* print usage to stderr
	* sort options (usage and manpage)
	* use getprogname(3)
        * machine -> host (sync with manpage)

Index: rdist/main.c
===================================================================
RCS file: /cvs/cvsroot/src/usr.bin/rdist/main.c,v
retrieving revision 1.16
diff -u -r1.16 main.c
--- rdist/main.c	5 Jan 2004 23:23:36 -0000	1.16
+++ rdist/main.c	10 Jul 2004 04:21:15 -0000
@@ -237,8 +237,14 @@
 static void
 usage(void)
 {
-	printf("usage: rdist [-nqbRhivwyD] [-f distfile] [-d var=value] [-m host] [file ...]\n");
-	printf("or: rdist [-nqbRhivwyD] -c source [...] machine[:dest]\n");
+
+	(void)fprintf(stderr,
+	    "usage: %s [-bDhinqRvwy] [-f distfile] [-d var=value] [-m host]"
+	    " [name ...]\n",
+	    getprogname());
+	(void)fprintf(stderr,
+	    "or   : %s [-bDhinqRvwy] -c name ... [login@]host[:dest]\n",
+	    getprogname());
 	exit(1);
 }
 
Index: rdist/rdist.1
===================================================================
RCS file: /cvs/cvsroot/src/usr.bin/rdist/rdist.1,v
retrieving revision 1.17
diff -u -r1.17 rdist.1
--- rdist/rdist.1	7 Aug 2003 11:15:37 -0000	1.17
+++ rdist/rdist.1	9 Jul 2004 19:05:24 -0000
@@ -37,13 +37,13 @@
 .Nd remote file distribution program
 .Sh SYNOPSIS
 .Nm
-.Op Fl nqbRhivwyD
+.Op Fl bDhinqRvwy
 .Op Fl f Ar distfile
 .Op Fl d Ar var=value
 .Op Fl m Ar host
 .Op Ar name ...
 .Nm
-.Op Fl nqbRhivwyD
+.Op Fl bDhinqRvwy
 .Fl c
 .Ar name ...
 .Oo login@ Oc Ns Ar host Ns Op :dest
>Release-Note:
>Audit-Trail:
>Unformatted: