summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/dmount10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/dmount b/bin/dmount
index 45448e3..0cb7296 100755
--- a/bin/dmount
+++ b/bin/dmount
@@ -62,7 +62,15 @@ elsif ($ARGV[0] eq '--list') {
elsif ($ARGV[0] eq '--bashcomp') {
print <<"EOF";
_dmount_list() {
- COMPREPLY=( $( compgen -W '\$($cmd --list)' -- "\$2" ) )
+ local -a list
+ local item
+ while read -r item; do
+ list+=( "$item")
+ done < <(dmount --list)
+ COMPREPLY=()
+ while read -r item; do
+ COMPREPLY+=( "${item@Q}" )
+ done < <( compgen -W "${list[*]@Q}" -- "$2" )
}
complete -F _dmount_list $cmd