On Sat May 15 09:54:25 EDT 2010, [email protected] wrote:
> > '--' tells the Plan 9 program argument parser to stop looking for
> > options.  See arg(2).
> 
> so is it a program dependent feature in the sence that I must know
> which program uses arg(2) and which does not?
> (E.g that grep uses it but some other command (is there any?) does not?)
> Must I read the program's source or should it be documented in man
> pages? -- there is nothing about this in the man page of grep...

for the record, grep also accepts -e which escapes the next option.

here's a list of all the single-file commands in /sys/src that don't
use ARGBEGIN/ARGEND.  compiling a comprehensive list is
an exercize left to the reader.  of course, only a hand full of
shell scripts use getflags and conform to the general convention.

- erik

---

 ; x=`{grep -l ARGBEGIN *.c}
; for(i in *.c) if (! ~ $i $x) echo $i
ar.c
awd.c
basename.c
cal.c
cat.c
chmod.c
clock.c
dd.c
echo.c
factor.c
fortune.c
getmap.c
html2ms.c
join.c
kbmap.c
kprof.c
lens.c
mc.c
msleep.c
mv.c
p.c
pbd.c
pr.c
pwd.c
sleep.c
sort.c
swap.c
tail.c
test.c
time.c
tprof.c
uniq.c
unlnfs.c
unmount.c
xd.c

Reply via email to