On 20/05/12(Sun) 11:26, Kenneth R Westerback wrote: > On Sun, May 20, 2012 at 04:46:40PM +0200, Martin Pieuchot wrote: > > Diff below makes eject(1) use cd0 as default device like cdio(1) does. > > > > I'm aware this is an arbitrary choice but I see no drawback in having > > a default device to eject and this behavior is coherent with cdio(1)'s. > > > > Ok? > > Then again, actual testing shows that I the man page is unclear > and a bare 'eject' does not eject st0. I'd rather have eject > use 'st0' as the default device since it is a varient of the 'mt' > command.
Forget about the default, as I said it was an arbitrary choice and there is no consensus. > This could be made more clear on the man page. :-) Actually I see no reason at all to mention that eject(1) is a variant of mt(1) because it is not limited to tapes and the manual is confusing. So I've split the manual in two, does it look clearer to you? Index: Makefile =================================================================== RCS file: /cvs/src/bin/mt/Makefile,v retrieving revision 1.8 diff -u -p -r1.8 Makefile --- Makefile 28 Oct 2009 05:17:19 -0000 1.8 +++ Makefile 20 May 2012 15:50:50 -0000 @@ -7,6 +7,6 @@ DPADD= ${LIBUTIL} LDADD= -lutil LINKS= ${BINDIR}/mt ${BINDIR}/eject -MLINKS= mt.1 eject.1 +MAN= mt.1 eject.1 .include <bsd.prog.mk> Index: eject.1 =================================================================== RCS file: eject.1 diff -N eject.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ eject.1 20 May 2012 16:16:17 -0000 @@ -0,0 +1,64 @@ +.\" $OpenBSD: mt.1,v 1.28 2010/09/03 13:14:55 jmc Exp $ +.\" $NetBSD: mt.1,v 1.8 1996/05/21 10:23:55 mrg Exp $ +.\" +.\" Copyright (c) 1981, 1990, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)mt.1 8.1 (Berkeley) 6/6/93 +.\" +.Dd $Mdocdate: September 3 2010 $ +.Dt EJECT 1 +.Os +.Sh NAME +.Nm eject +.Nd eject a removable media +.Sh SYNOPSIS +.Nm eject +.Op Fl t +.Ar device +.Sh DESCRIPTION +The +.Nm +utility ejects a media from +.Pa device . +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl t +Insert the media instead of ejecting. +For the +.Xr cd 4 +driver, this requests that the tray be closed. +.El +.Sh EXAMPLES +Eject the first CD device. +This will work even if there is no CD in the drive: +.Pp +.Dl $ eject /dev/rcd0c +.Sh SEE ALSO +.Xr mt 1 , +.Xr cdio 1 Index: mt.1 =================================================================== RCS file: /cvs/src/bin/mt/mt.1,v retrieving revision 1.28 diff -u -p -r1.28 mt.1 --- mt.1 3 Sep 2010 13:14:55 -0000 1.28 +++ mt.1 20 May 2012 16:25:31 -0000 @@ -34,17 +34,13 @@ .Dt MT 1 .Os .Sh NAME -.Nm mt , -.Nm eject -.Nd magnetic tape and removable media manipulating program +.Nm mt +.Nd magnetic tape manipulating program .Sh SYNOPSIS .Nm mt .Op Fl f Ar device .Ar command .Op Ar count -.Nm eject -.Op Fl t -.Ar device .Sh DESCRIPTION The .Nm @@ -67,18 +63,8 @@ or .Nm writes to the named tape device on the remote host using .Xr rmt 8 . -.Nm eject -is simply an alias for -.Nm mt , -with the -.Cm offline -command specified. -.Nm eject -may also be used to eject other types of removable media. .Pp -The options for -.Nm -are as follows: +The options are as follows: .Bl -tag -width Ds .It Fl f Ar device Operate on the @@ -86,17 +72,6 @@ Operate on the specified. .El .Pp -The options for -.Nm eject -are as follows: -.Bl -tag -width Ds -.It Fl t -Insert the device instead of ejecting. -For the -.Xr cd 4 -driver, this requests that the tray be closed. -.El -.Pp The available commands are listed below. Only as many characters as are required to uniquely identify a command need be specified. @@ -155,10 +130,6 @@ does not exist, .Nm uses the device .Pa /dev/rst0 . -The -.Ev TAPE -variable is ignored by -.Nm eject . .Sh ENVIRONMENT If the following environment variable exists, it is utilized by .Nm mt . @@ -185,13 +156,7 @@ list of SCSI2 density codes .Nm returns a 0 exit status when the operation(s) were successful, 1 if the command was unrecognized, and 2 if an operation failed. -.Sh EXAMPLES -Eject the first CD device. -This will work even if there is no CD in the drive: -.Pp -.Dl $ eject /dev/rcd0c .Sh SEE ALSO -.Xr cdio 1 , .Xr chio 1 , .Xr dd 1 , .Xr ioctl 2 ,