Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 79007

Summary: completion generating function?
Product: Gentoo Linux Reporter: Ciaran McCreesh <ciaran.mccreesh>
Component: New packagesAssignee: Gentoo Shell Tools project <shell-tools>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ciaran McCreesh 2005-01-21 14:53:08 UTC
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:
start_bash_completion_script 'myapp'
add_bash_completion_options '--bar' '--baz'
add_bash_completion_files '*.app'
end_bash_completion_script

This probably needs thinking out quite a bit more...
Comment 1 Tom Martin (RETIRED) gentoo-dev 2005-01-23 02:38:19 UTC
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?
Comment 2 Ciaran McCreesh 2005-01-23 04:38:50 UTC
Mmm. Personally I'm not a fan of parsing --help or similar.
Comment 3 Ciaran McCreesh 2005-12-16 19:14:52 UTC
Mmm, it's almost as much work creating a description of commandline options as it is just writing a completion file. Guess not...