Bug 18667 - mktemp(1) binary, or manpage / usage() is incorrect
Summary: mktemp(1) binary, or manpage / usage() is incorrect
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: alex
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-05-19 01:20 UTC by David O'Brien
Modified: 2000-10-15 12:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David O'Brien 2000-05-19 01:20:00 UTC
	The mktemp(1) man page states:
	SYNOPSIS
		mktemp [-d] [-q] [-t prefix] [-u] [template ...]

	The mktemp usage() is:
	usage: mktemp [-d] [-q] [-t prefix] [-u] [template ...]

	Both of these say all arguments to mktemp are optional.  However
	mktemp(1) will not do anything useful w/o being run w/arguments.

Fix: 

1st must decided what is the correct operation.
How-To-Repeat: 
	/usr/bin/mktemp
Comment 1 k 2000-08-04 21:31:02 UTC
Hi David

What do you think about the following patch mktemp usage?

Am I correct in the assumption that you are obrien@freebsd.org ?

If so and the patch seems ok, maybe you can comitt it.

Index: mktemp.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.1,v
retrieving revision 1.9
diff -u -r1.9 mktemp.1
--- mktemp.1	2000/06/04 09:11:22	1.9
+++ mktemp.1	2000/08/04 20:22:15
@@ -42,9 +42,14 @@
 .Nm mktemp
 .Op Fl d
 .Op Fl q
-.Op Fl t Ar prefix
 .Op Fl u
+.Ar template
 .Op Ar template ...
+.Nm mktemp
+.Op Fl d
+.Op Fl q
+.Op Fl u
+.Fl t Ar prefix
 .Sh DESCRIPTION
 The
 .Nm
Index: mktemp.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.c,v
retrieving revision 1.2
diff -u -r1.2 mktemp.c
--- mktemp.c	1998/05/05 06:13:47	1.2
+++ mktemp.c	2000/08/04 20:20:03
@@ -145,6 +145,8 @@
 usage()
 {
 	fprintf(stderr,
-		"usage: mktemp [-d] [-q] [-t prefix] [-u] [template ...]\n");
+		"usage: mktemp [-d] [-q] [-u] template [template ...]\n");
+	fprintf(stderr,
+		"       mktemp [-d] [-q] [-u] -t prefix \n");
 	exit (1);
 }
Comment 2 Sheldon Hearn 2000-08-07 09:54:30 UTC
On Fri, 04 Aug 2000 13:40:03 MST, Johan Karlsson wrote:

>  +.Ar template
>   .Op Ar template ...

Better expressed as

.Ar template ...

>  +		"usage: mktemp [-d] [-q] [-u] template [template ...]\n");
>  +	fprintf(stderr,
>  +		"       mktemp [-d] [-q] [-u] -t prefix \n");

Again, more consistently expressed at 

	usage: mktemp [-d] [-q] [-u] template ...

The optional nature of arguments implied by ellipsis is implicit. ;-)

Ciao,
Sheldon.
Comment 3 k 2000-08-07 10:02:30 UTC
At Mon, 07 Aug 2000 10:54:30 +0200, Sheldon Hearn wrote:
> The optional nature of arguments implied by ellipsis is implicit. ;-)


Ok, a new try :-)

/Johan K

Index: mktemp.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.1,v
retrieving revision 1.9
diff -u -r1.9 mktemp.1
--- mktemp.1	2000/06/04 09:11:22	1.9
+++ mktemp.1	2000/08/07 08:59:28
@@ -42,9 +42,13 @@
 .Nm mktemp
 .Op Fl d
 .Op Fl q
-.Op Fl t Ar prefix
 .Op Fl u
-.Op Ar template ...
+.Ar template ...
+.Nm mktemp
+.Op Fl d
+.Op Fl q
+.Op Fl u
+.Fl t Ar prefix
 .Sh DESCRIPTION
 The
 .Nm
Index: mktemp.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.c,v
retrieving revision 1.2
diff -u -r1.2 mktemp.c
--- mktemp.c	1998/05/05 06:13:47	1.2
+++ mktemp.c	2000/08/07 08:59:55
@@ -145,6 +145,8 @@
 usage()
 {
 	fprintf(stderr,
-		"usage: mktemp [-d] [-q] [-t prefix] [-u] [template ...]\n");
+		"usage: mktemp [-d] [-q] [-u] template ...\n");
+	fprintf(stderr,
+		"       mktemp [-d] [-q] [-u] -t prefix \n");
 	exit (1);
 }
Comment 4 Sheldon Hearn 2000-08-07 10:25:35 UTC
On Mon, 07 Aug 2000 11:02:30 +0200, Johan Karlsson wrote:

> Ok, a new try :-)

I like what you have now.

Ciao,
Sheldon.
Comment 5 k 2000-10-13 10:20:12 UTC
Reading the manpage and src I've come up with the atteched patch 
which describes the usage of mktemp(1) more accuratly than my prev 
patch.


Index: usr.bin/mktemp/mktemp.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.1,v
retrieving revision 1.9
diff -u -r1.9 mktemp.1
--- usr.bin/mktemp/mktemp.1	2000/06/04 09:11:22	1.9
+++ usr.bin/mktemp/mktemp.1	2000/10/13 09:17:07
@@ -44,7 +44,12 @@
 .Op Fl q
 .Op Fl t Ar prefix
 .Op Fl u
-.Op Ar template ...
+.Ar template ...
+.Nm mktemp
+.Op Fl d
+.Op Fl q
+.Op Fl u
+.Fl t Ar prefix
 .Sh DESCRIPTION
 The
 .Nm
Index: usr.bin/mktemp/mktemp.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/mktemp/mktemp.c,v
retrieving revision 1.2
diff -u -r1.2 mktemp.c
--- usr.bin/mktemp/mktemp.c	1998/05/05 06:13:47	1.2
+++ usr.bin/mktemp/mktemp.c	2000/10/13 09:16:38
@@ -145,6 +145,8 @@
 usage()
 {
 	fprintf(stderr,
-		"usage: mktemp [-d] [-q] [-t prefix] [-u] [template ...]\n");
+		"usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n");
+	fprintf(stderr,
+		"       mktemp [-d] [-q] [-u] -t prefix \n");
 	exit (1);
 }
Comment 6 Johan Karlsson freebsd_committer freebsd_triage 2000-10-13 10:23:30 UTC
Responsible Changed
From-To: freebsd-bugs->alex

Another commit-candidate.
Comment 7 alex freebsd_committer freebsd_triage 2000-10-15 12:36:54 UTC
State Changed
From-To: open->closed

Changed in HEAD and RELENG_4.