airlift / airline

Java annotation-based framework for parsing Git like command line structures
Apache License 2.0
846 stars 141 forks source link

Interactive command line #49

Open fabienrenaud opened 8 years ago

fabienrenaud commented 8 years ago

I can't use airline to build a personal interactive command line, can I? Classic example of such:

php -a; python; mysql;

Then you type all the commands within and it works.

I know it doesn't make sense for all the applications which provide an interactive terminal, but it would be very convenient for the ones that just want to be a subset of what terminal commands are...

Edit: less than 1 minute later after writing this post, i re-read the README and i believe this is actually possible. :) (and -_- on me) Will confirm soon.

fabienrenaud commented 8 years ago

Short answer: it can be done and it's easy.

But:

And I also just found out that the scope of all my command classes must be public which sucks for an annotation framework i think (note: minor inconvenience, still many thanks for the framework :) )

electrum commented 8 years ago

This is a cool idea. I recommend using jline2 for the input handling: https://github.com/jline/jline2

We could even do some advanced integration with JLine's completion support.