Open markhibberd opened 10 years ago
There are two ways, probably only one of which is practical given java start-up times.
The problem with (1) is startup time but given some tuning and -client
or jdk8 it is possible,
The problem with (2) it is hard to encode the dynamic completions (i.e. context dependent completion, e.g. after I enter a sub command what are the valid flags).
Not sure of best, but it would be really nice.
I was looking around for examples of Java/Scala libraries that did something similar but I couldn't find anything (I might be blind though). I agree it would be great.
This is a haskell library that does it using a fairly similar structured parser to the applicative one in pirate: http://hackage.haskell.org/package/optparse-applicative-0.9.0/docs/src/Options-Applicative-BashCompletion.html#bashCompletionParser
Perhaps a dumb question - is this only possible if we do something like generate the bash/zsh files (and I guess add an SBT plugin to make that easy)?