From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pA9AJfa4007142 for ; Wed, 9 Nov 2011 05:19:42 -0500 (EST) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id D81E614EA32 for ; Wed, 9 Nov 2011 11:19:35 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id KTSNKLhaSGKj for ; Wed, 9 Nov 2011 11:19:34 +0100 (CET) X-KTH-Auth: kristaps [83.250.3.9] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from macky.local (c83-250-3-9.bredband.comhem.se [83.250.3.9]) by smtp-2.sys.kth.se (Postfix) with ESMTP id F40E714D7CB for ; Wed, 9 Nov 2011 11:19:32 +0100 (CET) Message-ID: <4EBA53B4.3070306@bsd.lv> Date: Wed, 09 Nov 2011 11:19:32 +0100 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: overhaul apropos(1) interface References: <20111109013044.GA25679@iris.usta.de> In-Reply-To: <20111109013044.GA25679@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 09/11/2011 02:30, Ingo Schwarze wrote: > Hi, > > the interface of the apropos utility in the mandoc package > is very different from traditional apropos, and the -t option > hinders logical extensions, as discussed previously. > So, here is a first step to fix this, doing various things: > > INTERFACE CHANGES: > * drop the -s (sort) option, it clashes with -s (section) > * introduce -N (numerical sort) instead > * drop the -c (cat) option, it clashes with -c (copy to stdout) > * rename it to the usual -s (section) > * drop the -a (arch) option, it clashes with -a (all) > * rename it to the usual -S (subsection) > * drop the -t (search type), it clashes with -t (use troff) > * use a macro= syntax instead, as discussed > * drop -e (exact) and -r (regex), it belongs to each query phrase > * use a macro== and macro=~ syntax instead > > The new syntax is: > > apropos [-IN] [-s section] [-S arch] query_phrase [...] > > query_phrase ::= [[macro[,...]](=|==|=~)]query_value > > Multiple query phrases are not yet implemented, but they are to > be or'ed in the future. > > The operators are: > > = substring match > == exact match > =~ regex match > > If no operator is given, = is assumed. > Multiple macros can be given, joined with commas, they are or'ed. > If no macro is given, "Nm,Nd" is assumed. > > STRUCTURAL CLEANUP: > * collect the common defines for mandocdb and apropos in mandocdb.h > * name the TYPE_ bitfield constants according to the new interface > * drop types and match from the global struct opts > because these are local to each query phrase > * drop the enum sort; for an alternative, a bool is sufficient > * drop the local dbf and idxf strings, use those in the global struct > > This is lightly tested, but given that we are not yet in production > and lots of heavy changes are needed in after this, i consider > light testing sufficient. > > OK? > > Of course, when committing, i'm going to change the manual, too. > > And by the way, this patch is +144 -175 :-). Unfortunately, this comes in after an overhaul I checked in last night. However, that overhaul overwhelmingly concerns the search function itself, not the interface, so there are few conflicts -- just name changes. I'll piece this into the new version soon. K. -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv