On Jul 15 21:46:21, j...@kerhand.co.uk wrote: > On Mon, Jul 15, 2013 at 07:53:04PM +0200, Jan Stary wrote: > > Some of the manpages, e.g. crontab(1), > > markup the folklore phrase > > > > named file, or standard input > > if the pseudo-filename `-' is given > > > > as > > > > named file, or standard input > > if the pseudo-filename > > .Sq Fl > > is given. > > > > Is this correct semantic markup? IMHO not: > > it just abuses the fact that the flags (Fl) > > happen to start with a dash; but that's not > > what is meant here; this is not a flag; > > it is the literal dash that is recognized > > in place of a filename. > > > > So I believe it should be simply > > > > .Sq - > > > > Right? > > > > The diff below replaces those occurences > > that a grep revealed for me in /usr/share/man; > > Another grep reveals that most other manpages > > actually use ".Sq -". > > > > I left out oldrdist(1) and shutdown(8) > > where it _is_ actually a flag > > and the code processes it as such. > > > > Jan > > > > ok, i agree with this. Fl seems wrong. however there's some ambiguity, > for me anyway - do oldrdist and shutdown actually process "-" > differently, or do the manuals talk about them differently? > > for oldrdist, "-" is actually the argument to -f. so it's not an option, > as far as i can see. just the manual seems to blur things by documenting > "If either the -f or `-' option is not specified", whereas above, the > text suggests "-f-" or "-f -" is how it would work.
You are right: the `-' is actually an argument to -f, and the manpage wording just confuses things by talking about "the `-' option". BTW, it uses ".Dq" everywhere else. Index: oldrdist.1 =================================================================== RCS file: /cvs/src/usr.bin/oldrdist/oldrdist.1,v retrieving revision 1.20 diff -u -p -u -p -r1.20 oldrdist.1 --- oldrdist.1 3 Sep 2011 22:59:07 -0000 1.20 +++ oldrdist.1 15 Jul 2013 21:38:51 -0000 @@ -69,11 +69,9 @@ is the standard input is used. .El .Pp -If either the -.Fl f -or -.Sq Fl -option is not specified, the program looks first for +If the +.Ar distfile +is not specified, the program looks first for .Dq Pa distfile , then .Dq Pa Distfile > similarly, look at cat(1): > > If file is a single dash (`-') or absent, cat reads from the > standard input. > > no mention of "-" in SYNOPSIS. Yes; here it does not suggest that `-' is an option, just that it is recognized as a special value for `file' (which is described in SYNOPSIS). Incidentaly, it uses .Pq Sq \&- Why cannot this be just .Pq Sq - ? > but shutdown(8), which lists "-" in > SYNOPSIS: > > If `-' is supplied as an option, the warning message is read > from standard input. > > so, it looks like oldrdist and shutdown are just talking about "-" > differently to other manuals, but not behaving differently to other > apps. i.e. we should tweak oldrdist and shutdown too. shutdown code actually recognizes `-' as a getopt case: it is technically an option, meaning "do not expect the message on the commandline, read it from stdin instead".