

Compleat: Programmable bash completion for human beings - mbrubeck
http://limpet.net/mbrubeck/2009/10/30/compleat.html

======
10ren
This is the kind of project I really like; it's the way things should be. Very
awesome. This _should_ become universal. A barrier to adoption is that the
installation process seems a bit scary/involved - if it was straightforward,
this would fly off the shelves like hotcakes (...er), and become part of the
standard bash distribution.

I wrote something similar recently (in terms of tech, not in terms of
application): a parser for a language with which the user can specify another
language (which is used to parse something else). With a lot of experience in
it (including a compiler subject at uni), and having written similar things
before, professionally and in research, and including reusing some aspects
from previous code, it took me 2 weeks - in Java.

How long did it take you? I'm thinking it might have been much faster for you,
even without those benefits I had, because you wrote in Haskell...

Does anyone know if there is a Haskell that targets the JVM? That could be a
cool solution for me...

I want to note that while 2 weeks seems like a long time, it's fairly
straightforward once you know how; the hard work is in what comes before it:
coming up with the concept, the design of the language etc.

BTW: "GitHub is Temporarily Offline." <http://github.com>

~~~
mbrubeck
Argh! Here's a hastily-setup mirror. Yay for distributed version control!

<http://limpet.net/mbrubeck/projects/compleat/>

The first commit was on October 6, so this release took about three weeks of
programming (mostly on the bus and when I should have been in bed sleeping).
And you're totally right - a lot of the work was done in my head long before I
typed "git init."

The very next thing on my to-do list is learning the right way to package this
with Cabal so that a single command will install and configure it, and so I
can provide pre-built Debian and Ubuntu packages.

~~~
10ren
Pre-built packages sounds perfect! Though I think you deserve a rest while you
bask in adulation. :-) Your idea is worthy of the original unix hackers...
and, in keeping with their spirit, made real.

BTW: I actually took a little over 2 weeks (2-3 days extra), and I was working
full-time (though that amounts to only about 2-3 hours of 100% concentrated
hacking); you also did extra stuff with integrating it with bash, and I'm sure
fiddling with it a bit to make it a practically usable tool. So I think the
implementation time is within a factor of 2, for Java vs. Haskell.

------
scott_s
Good idea for a tool, great writeup of the implementation. This struck home
for me:

 _I realized recently that some things I do are so specialized that my parents
and non-programmer friends will probably never get them. For example, Compleat
is a program to generate programs to help you… run programs? Sigh. Well, maybe
someone out there will appreciate it._

Just about all of my research falls into that category.

------
cldwalker
You all may be interested in these two ruby-based bash completion libraries:
<http://github.com/drnic/tabtab#readme> and
<http://github.com/cldwalker/lightning#readme>. The former is similar to
compleat in wanting to make command completion easy to define but it does it
through a ruby dsl instead of usage statements. The latter autocompletes paths
given a yaml file of paths.

~~~
mbrubeck
Nice! I hadn't seen these before. I was actually surprised not to find more
similar work when I searched for it, so it's nice to know other people are
dealing with the same problems.

