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
--- 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
}