On Thu, Sep 13, 2007, barjunk wrote:
> On Sep 12, 11:28 am, Ben Bleything <bbleyth... / laika.com> wrote:
> >  * Linen -- A framework for building command-line interfaces
>
> This looks interesting.  If someone wasn't using this, what would they
> use?

That's an interesting question.  At the time we started on Linen, we
didn't know about HighLine[1].  Had we, Linen would look different
today.  That said, HighLine is, at its core, a wrapper for Readline that
gives you a bunch of really nice ways to ask the user for input.

Linen was designed to be the underlying framework of an application that
adds host to our directory server.  We call it "a framework for building
command-line interfaces", but what Linen is really about is defining
how to get input from the user and what to do with it once you have
it.  This latter bit is what HighLine doesn't do for you.  It's just a
different philosophy; we needed to build a system where the user could
define the action in a similar way to how they define the input.

Command line interfaces aren't the end.  Linen's designed to be agnostic
of the handler, only telling you what the input should look like and
what should be done with it.  We've toyed with the idea of writing a web
handler for Linen plugins, and I personally would like to try to write a
handler that you could plug into an Asterisk IVR.  Both of those should
be possible (though maybe somewhat less than trivial ;))

Around the time Linen was hitting 0.3 or 0.4 internally (we only
released it publically now), there was another similar library released.
It's called main[2], and it's closer to Linen than HighLine in some
ways.  It too defines the action that's taken after the arguments are
validated.  The main (the adjective) difference is that main (the
library) doesn't (seem to) provide an interactive environment... it
gives you command line flags and usage methods and stuff.  Linen does
the interactive thing.  Again, just a difference of philosophy.  Linen
will someday have a batch mode that looks just like main :)

Hope that answers your question, and wasn't too long-winded!

Ben

[1]: http://highline.rubyforge.org/
[2]: http://codeforpeople.com/lib/ruby/main/