bash_completion: always use single quotes with compgen -W
This avoids a bug in bash 2.05a
--- a/contrib/bash_completion Fri Jan 27 12:10:35 2006 +0100
+++ b/contrib/bash_completion Fri Jan 27 12:11:14 2006 +0100
@@ -41,14 +41,14 @@
all=$(_hg_command_list)
commands=${all%%$'\n'debug*}
- result=$(compgen -W "$commands" -- "$cur")
+ result=$(compgen -W '$commands' -- "$cur")
# hide debug commands from users, but complete them if
# there is no other possible command
if [ "$result" = "" ]; then
local debug
debug=debug${all#*$'\n'debug}
- result=$(compgen -W "$debug" -- "$cur")
+ result=$(compgen -W '$debug' -- "$cur")
fi
COMPREPLY=(${COMPREPLY[@]:-} $result)
@@ -57,7 +57,7 @@
_hg_paths()
{
local paths="$(hg paths | sed -e 's/ = .*$//')"
- COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$paths" -- "$cur" ))
+ COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$paths' -- "$cur" ))
}
_hg_repos()
@@ -71,13 +71,13 @@
_hg_status()
{
local files="$( hg status -n$1 . )"
- COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$files" -- "$cur" ))
+ COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W '$files' -- "$cur" ))
}
_hg_tags()
{
local tags="$(hg tags | sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')"
- COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$tags" -- "$cur") )
+ COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur") )
}
# this is "kind of" ugly...
@@ -123,7 +123,7 @@
if [[ "$cur" == -* ]]; then
opts=$(_hg_option_list $cmd)
- COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$opts" -- "$cur") )
+ COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W '$opts' -- "$cur") )
return
fi