bash completions: work correctly with subdirs, ie. 'redo t/<tab>'
This commit is contained in:
parent
fa4b64285d
commit
d5beda0ffe
1 changed files with 9 additions and 9 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
_redo()
|
_redo_completions()
|
||||||
{
|
{
|
||||||
local cur
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
COMPREPLY=()
|
local targets=$(
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
for t in $cur*.do; do
|
||||||
|
echo "${t%.do}"
|
||||||
local targets=$(for t in `ls *.do | sed 's/\.do$//'`; do echo ${t}; done)
|
done
|
||||||
|
)
|
||||||
COMPREPLY=($(compgen -W "${targets}" $cur))
|
COMPREPLY=($(compgen -W "$targets" $cur))
|
||||||
}
|
}
|
||||||
|
|
||||||
complete -F _redo redo
|
complete -F _redo_completions redo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue