tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Support for boolean queries in apropos
On Thu, 15 Mar 2012 07:39:28 +0000 (GMT)
Iain Hibbert <plunky%rya-online.net@localhost> wrote:
> > We do have some prior art. The Bourne shell and test(1) use !, -a,
> > and -o. find(1) and nmh use !, -and, and -or. SQL and tcpdump use
> > 'not', 'and', and 'or'. Would it be so very bad to use one of
> > those? Surely anyone typing "apropos" in a shell has used, or at
> > least will soon use, one of those utilities.
>
> I'd like to suggest that spending effort making this too capable is
> not necessarily a good idea (except as academic exercise :)
I appreciate the desire for simplicity and believe it or not I'm
tempted to agree. At the same time, I'm sure you've noticed that
documentation has only gotten more voluminous and verbose. Abhinav,
who's implementing this, raised the question of syntax because he found
in his own early, limited testing that it would be useful.
If you're going to implement two of the three basic Boolean operations,
you really might as well have the third, as I pointed out, for the
user's sake. Because it's really already there, just obscure.
> as this is a human interface tool, not a database selector.
Erm, the relational model adopted Boolean logic to provide a human
interface to data.
> % apropos -8 "add new user" -git -ssh
[scratching head] What does the -git option to apropos do? Is -8 an
option, or part of the query syntax? I think (honestly) you meant "not
8", but I read it as "only 8".
Does this really mean the same?
% apropos -8 -git -ssh "add new user"
My version of your query suggests, on a command line, something very
different from what you intend, or what would be expected in a search
box. The same cannot be said of
% apropos 8 not git and not ssh and "add new user"
or
% apropos 8 'not (git or ssh) and "add new user" '
We should look to our own tradition here, not import a
syntax-of-the-masses just because it happens to be familar in 2012.
--jkl
Home |
Main Index |
Thread Index |
Old Index