##// END OF EJS Templates
bash: Add smarter completion of add/commit/remove/forget/diff/revert...
mpm@selenic.com -
r935:925563ff default
parent child Browse files
Show More
@@ -19,6 +19,12 b''
19 COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$paths" -- "$cur" ))
19 COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$paths" -- "$cur" ))
20 }
20 }
21
21
22 _hg_status()
23 {
24 local files="$( hg status -$1 | cut -b 3- )"
25 COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$files" -- "$cur" ))
26 }
27
22 _hg_tags()
28 _hg_tags()
23 {
29 {
24 local tags="$(hg tags | sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')"
30 local tags="$(hg tags | sed -e 's/[0-9]*:[a-f0-9]\{40\}$//; s/ *$//')"
@@ -104,6 +110,24 b''
104 paths)
110 paths)
105 _hg_paths
111 _hg_paths
106 ;;
112 ;;
113 add)
114 _hg_status "u"
115 ;;
116 commit)
117 _hg_status "mra"
118 ;;
119 remove)
120 _hg_status "r"
121 ;;
122 forget)
123 _hg_status "a"
124 ;;
125 diff)
126 _hg_status "mra"
127 ;;
128 revert)
129 _hg_status "mra"
130 ;;
107 clone)
131 clone)
108 local count=$(_hg_count_non_option)
132 local count=$(_hg_count_non_option)
109 if [ $count = 1 ]; then
133 if [ $count = 1 ]; then
@@ -126,4 +150,4 b''
126
150
127 }
151 }
128
152
129 complete -o filenames -F _hg hg
153 complete -o default -F _hg hg
General Comments 0
You need to be logged in to leave comments. Login now