This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bash_completion for ecosconfig


Hello,

Has anyone own bash_completion for ecosconfig? If you have, please, give
yours for us (CLI guys :-) Today I thought, Why I have not such a thing?
I'm not familiar with all bash completion insides, so, I found one nice
template and just adopt it.

# lazy bash_completion for ecosconfig
_ecosconfig() {
	COMPREPLY=()
	local cur="${COMP_WORDS[COMP_CWORD]}"
	local opts="add check export import list new remove resolve target template tree version cygmon cygmon_no_kernel default kernel lwip_eth lwip_ppp minimal net old_net posix redboot stubs uitron"

	COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
}
complete -F _ecosconfig ecosconfig
# vim: set ft=sh:

SYNOPSYS

$ ecosconfig [TAB]
add               kernel            old_net           template
check             list              posix             tree
cygmon            lwip_eth          redboot           uitron
cygmon_no_kernel  lwip_ppp          remove            version
default           minimal           resolve           
export            net               stubs             
import            new               target


This lazy version is the very simple. It does not handle ecosconfig
qualifiers and other. But what I need to complete? I need to complete
recently used subcommands, my favorite target and package names (these
does not present there), no more than. So, that 'opts' variable can be
yours. Just change it. I hope that you can even grep/awk ecos.db to
inspire more power in that simple _ecosconfig() function.

Any scripts welcome!

Regards,

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]