changeset 1638:1c75487badd6

bash_completion: small updates and fixes - $result in _hg_commands is not an array - use "hg status ." - update "hg cat" completion - let bash itself generate the default completion
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 26 Jan 2006 14:52:26 +0100
parents 3b1b44b917f4
children dbfc04a55607
files contrib/bash_completion
diffstat 1 files changed, 2 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/bash_completion	Tue Jan 24 15:02:10 2006 +1300
+++ b/contrib/bash_completion	Thu Jan 26 14:52:26 2006 +0100
@@ -9,7 +9,7 @@
 				 -e '/^ [^ ]/!d; s/^ //; s/[,:]//g;'))
 
     commands="${all[*]##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
@@ -39,7 +39,7 @@
 
 _hg_status()
 {
-    local files="$( hg status -$1 | cut -b 3- )"
+    local files="$( hg status -$1 . | cut -b 3- )"
     COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$files" -- "$cur" ))
 }
 
@@ -167,17 +167,6 @@
 	debugdata)
 	    COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -X "!*.d" -- "$cur" ))
 	;;
-	cat)
-	    local count=$(_hg_count_non_option '-o|--output')
-	    if [ $count = 2 ]; then
-		_hg_tags
-	    else
-		COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -- "$cur" ))
-	    fi
-	;;
-	*)
-	    COMPREPLY=(${COMPREPLY[@]:-} $( compgen -f -- "$cur" ))
-	;;
     esac
 
 }