|
From: | Geir Hauge |
Subject: | Re: [Help-bash] How to keep only files match the prefix when do command completion? |
Date: | Wed, 14 Dec 2011 17:13:13 +0100 |
I have the following defined in bash. I'd like to complete commands for unsion by completing the profile files in ~/.unsion.
~$ complete -p unison
complete -o nospace -F _unison_command unison
~$ type _unison_command
_unison_command is a function
_unison_command ()
{
COMPREPLY=(`find ~/.unison -name '*.prf' -printf '%f\n'`);
return 0
}
When I type the following, it shows up every *.prf file in ~/.unison. I checked the usage in /etc/bash_completion, I don't see if I did anything obviously wrong. Yet, /etc/bash_completion can correctly do filtering, for example 'finger'.
unison some_prefix<TAB>
[Prev in Thread] | Current Thread | [Next in Thread] |