diff --git a/sshfs-mapper.completion b/sshfs-mapper.completion index d365127..06ae755 100644 --- a/sshfs-mapper.completion +++ b/sshfs-mapper.completion @@ -2,7 +2,7 @@ _sshfsmapper_opts() { - local cur prev sshfsmapper_opts + local cur prev sshfsmapper_opts sshfsmapper_maps COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" @@ -13,7 +13,8 @@ _sshfsmapper_opts() COMPREPLY=( $( compgen -W "$sshfsmapper_opts" -- $cur ) ) else if [[ "$prev" == -s ]]; then - COMPREPLY=( $( sshfs-mapper -l 2> /dev/null ) ) + sshfsmapper_maps=$( sshfs-mapper -l 2> /dev/null ) + COMPREPLY=( $( compgen -W "$sshfsmapper_maps" -- $cur ) ) else COMPREPLY=( $( compgen -W "$sshfsmapper_opts" -- $cur ) ) fi