2009-09-15 09:57:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
_sshfsmapper_opts()
|
|
|
|
{
|
2009-09-15 10:38:45 +00:00
|
|
|
local cur prev sshfsmapper_opts sshfsmapper_maps
|
2009-09-15 09:57:48 +00:00
|
|
|
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
|
|
|
|
sshfsmapper_opts='-s -h -i -l -u -a'
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
|
|
COMPREPLY=( $( compgen -W "$sshfsmapper_opts" -- $cur ) )
|
|
|
|
else
|
|
|
|
if [[ "$prev" == -s ]]; then
|
2009-09-15 10:38:45 +00:00
|
|
|
sshfsmapper_maps=$( sshfs-mapper -l 2> /dev/null )
|
|
|
|
COMPREPLY=( $( compgen -W "$sshfsmapper_maps" -- $cur ) )
|
2009-09-15 09:57:48 +00:00
|
|
|
else
|
|
|
|
COMPREPLY=( $( compgen -W "$sshfsmapper_opts" -- $cur ) )
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
complete -F _sshfsmapper_opts $default sshfs-mapper
|