On Wed, Apr 05, 2017 at 04:37:04PM +0200, Anton Lindqvist wrote: > Hi, > Support for decrementing a variable using the '-=' operator with > wsconsctl was added in r1.11 of wsconsctl.c. It never ended up being > documented. One might deduce that '-=' works since '+=' does. > However, I think adding documentation would be helpful. >
if it's decided this should be documented, i suggest we change the way we're documenting this. adding a separate synopsis is silly - i see you're just following what we do now though. i suggest removing the current += line from SYNSOPSIS and usage(), and amending the (perfectly good) description of name=value to include -=. but first we need to know whether we want to document this or not... jmc > Index: wsconsctl.8 > =================================================================== > RCS file: /cvs/src/sbin/wsconsctl/wsconsctl.8,v > retrieving revision 1.23 > diff -u -p -r1.23 wsconsctl.8 > --- wsconsctl.8 4 Aug 2008 07:32:51 -0000 1.23 > +++ wsconsctl.8 3 Apr 2017 18:33:08 -0000 > @@ -49,6 +49,10 @@ > .Op Fl n > .Op Fl f Ar file > .Ar name Ns += Ns Ar value ... > +.Nm wsconsctl > +.Op Fl n > +.Op Fl f Ar file > +.Ar name Ns -= Ns Ar value ... > .Sh DESCRIPTION > The > .Nm > @@ -77,6 +81,8 @@ The value can be specified as either an > symbol, > or as a relative value, by using the > .Ql += > +or > +.Ql -= > symbol. > See the > .Sx EXAMPLES > Index: wsconsctl.c > =================================================================== > RCS file: /cvs/src/sbin/wsconsctl/wsconsctl.c,v > retrieving revision 1.29 > diff -u -p -r1.29 wsconsctl.c > --- wsconsctl.c 8 May 2015 19:12:51 -0000 1.29 > +++ wsconsctl.c 3 Apr 2017 18:33:08 -0000 > @@ -72,8 +72,9 @@ usage(void) > "usage: %s [-an]\n" > " %s [-n] [-f file] name ...\n" > " %s [-n] [-f file] name=value ...\n" > - " %s [-n] [-f file] name+=value ...\n", > - __progname, __progname, __progname, __progname); > + " %s [-n] [-f file] name+=value ...\n" > + " %s [-n] [-f file] name-=value ...\n", > + __progname, __progname, __progname, __progname, __progname); > exit(1); > } >
