[Surfraw-devel] Surfraw elvi generator

Gabriel Lisaca gabriel.lisaca at gmail.com
Sat Nov 9 00:58:36 GMT 2019


Hello Ian,

On 9/11/19 9:49 AM, Ian Beckwith wrote:
> On Fri, Nov 08, 2019 at 05:00:52PM +1300, Gabriel Lisaca wrote:
>> I've been writing a program to generate surfraw elvi based on a higher-level
>> description.
> 
> Ooh! Please consider contributing it to surfraw.

Gladly, though it's written in Python--another large dependency.  It can 
be found here [1].

[1]: https://github.com/hoboneer/surfraw-elvis-generator/

It depends on Python 3.6, setuptools (for installing), and Jinja2 for 
templating.  It can also generate bash completions, though only for elvi 
called by themselves (so calls such as `sr $elvi` do not get completed); 
I'd like to work on integrating user-provided bash completions into 
surfraw.  I haven't kept the bash completions up-to-date with my recent 
changes in the elvi generation, so it's unlikely to complete --member 
options.  I can give an outline of what the program can do if 
requested--the README is a bit outdated.

>> As part of this, I wanted to make the process of generating elvi that follow
>> common conventions easy, but I'm not particularly sure what the
>> conventions--if any--are.
>>
>> So my question is: what are some commonly-used options for elvi and their
>> associated semantics?
> 
> Apart from the global options handled by every elvi (see surfraw -h)
> there is little consistency.

That's what I've noticed.  From reading the mailing list archives it 
seems that quite a few elvi authors have mistakenly overridden global 
options like -g.

> But a quick look at usage of (eg) -s shows it is used for widely
> different purposes in different elvi.

Would standardising the option names for elvi be off the table?  As it 
is, it's a tad jarring having to relearn (sometimes conflicting) option 
names that would be easier to use if they were uniform across all elvi. 
Just food for thought.

> -results *usually* lets you specify the number of results

Yeah, I've been looking to include that as a special-case, but something 
like a natural number option type (like the yes-no options in main 
surfraw) would be a more general solution that is simple enough to handle.

> Also, in case you aren't aware, and in case it is useful,
> have a look at the opensearch standard and elvi.
> 
> https://en.wikipedia.org/wiki/Opensearch

I've looked at the opensearch elvi briefly before, but seemed to be too 
cumbersome for my own uses.  I like the concept of an opensearch 
standard though!  Generating elvi from an opensearch description should 
be easy.

Thanks,
Gabriel



More information about the Surfraw-devel mailing list