Following a random discussion between me and ka0ttic on #gentoo-dev... Would it be possible for an eclass function which can create simple bash completion scripts? Not suitable for fancy apps, just for the little things that are along the lines of 'foo --bar --baz files...'.
Possible method #1:
make_bash_completion_script 'myapp' '--bar' '--baz' '_files_'
Possible method #2:
add_bash_completion_options '--bar' '--baz'
This probably needs thinking out quite a bit more...
Okay, I mentioned my idea for this to ka0ttic on #-dev.
There is a common GNU --help format. Many programs use it, for example, all the coreutils, df, feh, and a lot of others. When I saw this bug, it reminded me of the _gnu_generic completion widget which zsh uses to the same end. Would a standard --help parsing widget be a better solution, or would the semi-automated approach suggested in the original bug report be preferred?
Mmm. Personally I'm not a fan of parsing --help or similar.
Mmm, it's almost as much work creating a description of commandline options as it is just writing a completion file. Guess not...