author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
Sun, 02 Apr 2006 18:20:52 +0200 | |
changeset 2039 | 0c438fd25e6e |
parent 2035 | 107dc72880f8 |
child 2041 | 077a2da7f1de |
permissions | -rw-r--r-- |
1311
db8bebb08f8f
bash_completion: extended patterns require extglob option
TK Soh <teekaysoh@yahoo.com>
parents:
1308
diff
changeset
|
1 |
shopt -s extglob |
db8bebb08f8f
bash_completion: extended patterns require extglob option
TK Soh <teekaysoh@yahoo.com>
parents:
1308
diff
changeset
|
2 |
|
916 | 3 |
_hg_commands() |
4 |
{ |
|
1888
283d2ab1e020
Make bash_completion more robust for e.g. broken hgrc or old hg installations.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1887
diff
changeset
|
5 |
local commands |
283d2ab1e020
Make bash_completion more robust for e.g. broken hgrc or old hg installations.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1887
diff
changeset
|
6 |
commands="$("$hg" debugcomplete "$cur" 2>/dev/null)" || commands="" |
1887
913397c27cd8
new command debugcomplete
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1820
diff
changeset
|
7 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$commands' -- "$cur")) |
916 | 8 |
} |
9 |
||
10 |
_hg_paths() |
|
11 |
{ |
|
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
12 |
local paths="$("$hg" paths 2>/dev/null | sed -e 's/ = .*$//')" |
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
13 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$paths' -- "$cur")) |
916 | 14 |
} |
15 |
||
1587
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
16 |
_hg_repos() |
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
17 |
{ |
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
18 |
local i |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
19 |
for i in $(compgen -d -- "$cur"); do |
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
20 |
test ! -d "$i"/.hg || COMPREPLY=(${COMPREPLY[@]:-} "$i") |
1587
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
21 |
done |
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
22 |
} |
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
23 |
|
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
24 |
_hg_status() |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
25 |
{ |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
26 |
local files="$("$hg" status -n$1 . 2>/dev/null)" |
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
27 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur")) |
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
28 |
} |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
29 |
|
916 | 30 |
_hg_tags() |
31 |
{ |
|
2035
107dc72880f8
Make 'hg tags -q' only list tag names without revision numbers and hashes,
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2034
diff
changeset
|
32 |
local tags="$("$hg" tags -q 2>/dev/null)" |
107dc72880f8
Make 'hg tags -q' only list tag names without revision numbers and hashes,
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2034
diff
changeset
|
33 |
local IFS=$'\n' |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
34 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur")) |
916 | 35 |
} |
36 |
||
37 |
# this is "kind of" ugly... |
|
38 |
_hg_count_non_option() |
|
39 |
{ |
|
40 |
local i count=0 |
|
41 |
local filters="$1" |
|
42 |
||
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
43 |
for ((i=1; $i<=$COMP_CWORD; i++)); do |
916 | 44 |
if [[ "${COMP_WORDS[i]}" != -* ]]; then |
1152
ff560ce0c635
bash_completion: small cleanup and bugfix
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1151
diff
changeset
|
45 |
if [[ ${COMP_WORDS[i-1]} == @($filters|$global_args) ]]; then |
ff560ce0c635
bash_completion: small cleanup and bugfix
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1151
diff
changeset
|
46 |
continue |
ff560ce0c635
bash_completion: small cleanup and bugfix
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1151
diff
changeset
|
47 |
fi |
916 | 48 |
count=$(($count + 1)) |
49 |
fi |
|
50 |
done |
|
51 |
||
52 |
echo $(($count - 1)) |
|
53 |
} |
|
54 |
||
55 |
_hg() |
|
56 |
{ |
|
57 |
local cur prev cmd opts i |
|
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
58 |
# global options that receive an argument |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
59 |
local global_args='--cwd|-R|--repository' |
1683
063e04831a09
Use user specified path to hg in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1643
diff
changeset
|
60 |
local hg="$1" |
916 | 61 |
|
62 |
COMPREPLY=() |
|
63 |
cur="$2" |
|
64 |
prev="$3" |
|
65 |
||
1308
2073e5a71008
Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1263
diff
changeset
|
66 |
# searching for the command |
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
67 |
# (first non-option argument that doesn't follow a global option that |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
68 |
# receives an argument) |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
69 |
for ((i=1; $i<=$COMP_CWORD; i++)); do |
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
70 |
if [[ ${COMP_WORDS[i]} != -* ]]; then |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
71 |
if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
72 |
cmd="${COMP_WORDS[i]}" |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
73 |
break |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
74 |
fi |
916 | 75 |
fi |
76 |
done |
|
77 |
||
78 |
if [[ "$cur" == -* ]]; then |
|
2034
5e7aff1b6ae1
add --options to debugcomplete and change bash_completion to use it
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1888
diff
changeset
|
79 |
opts=$("$hg" debugcomplete --options "$cmd" 2>/dev/null) |
916 | 80 |
|
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
81 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$opts' -- "$cur")) |
916 | 82 |
return |
83 |
fi |
|
84 |
||
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
85 |
# global options |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
86 |
case "$prev" in |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
87 |
-R|--repository) |
1587
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
88 |
_hg_repos |
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
89 |
return |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
90 |
;; |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
91 |
--cwd) |
1587
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
92 |
# Stick with default bash completion |
1151
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
93 |
return |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
94 |
;; |
10b4f2a5ce17
teach bash_completion about --cwd
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1150
diff
changeset
|
95 |
esac |
916 | 96 |
|
97 |
if [ -z "$cmd" ] || [ $COMP_CWORD -eq $i ]; then |
|
98 |
_hg_commands |
|
99 |
return |
|
100 |
fi |
|
101 |
||
2039
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
102 |
# try to generate completion candidates for whatever command the user typed |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
103 |
local help |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
104 |
local canonical=0 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
105 |
if _hg_command_specific; then |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
106 |
return |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
107 |
fi |
1150
4ee09418c8e5
bash_completion: better handling of aliases
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1149
diff
changeset
|
108 |
|
2039
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
109 |
# canonicalize the command name and try again |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
110 |
help=$("$hg" help "$cmd" 2>/dev/null) |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
111 |
if [ $? -ne 0 ]; then |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
112 |
# Probably either the command doesn't exist or it's ambiguous |
916 | 113 |
return |
114 |
fi |
|
2039
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
115 |
cmd=${help#hg } |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
116 |
cmd=${cmd%%[$' \n']*} |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
117 |
canonical=1 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
118 |
_hg_command_specific |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
119 |
} |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
120 |
|
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
121 |
_hg_command_specific() |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
122 |
{ |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
123 |
if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
124 |
if [ $canonical = 1 ]; then |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
125 |
_hg_tags |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
126 |
return 0 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
127 |
elif [[ status != "$cmd"* ]]; then |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
128 |
_hg_tags |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
129 |
return 0 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
130 |
else |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
131 |
return 1 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
132 |
fi |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
133 |
fi |
916 | 134 |
|
135 |
case "$cmd" in |
|
136 |
help) |
|
137 |
_hg_commands |
|
138 |
;; |
|
1150
4ee09418c8e5
bash_completion: better handling of aliases
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1149
diff
changeset
|
139 |
export|manifest|update) |
916 | 140 |
_hg_tags |
141 |
;; |
|
1150
4ee09418c8e5
bash_completion: better handling of aliases
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1149
diff
changeset
|
142 |
pull|push|outgoing|incoming) |
916 | 143 |
_hg_paths |
1587
851bc33ff545
Less annoying directory completion (see http://bugs.debian.org/343458)
Daniel Kobras <kobras@debian.org>
parents:
1556
diff
changeset
|
144 |
_hg_repos |
916 | 145 |
;; |
146 |
paths) |
|
147 |
_hg_paths |
|
148 |
;; |
|
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
149 |
add) |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
150 |
_hg_status "u" |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
151 |
;; |
1150
4ee09418c8e5
bash_completion: better handling of aliases
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1149
diff
changeset
|
152 |
commit) |
1639
dbfc04a55607
_hg_status improvements in bash_completion:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1638
diff
changeset
|
153 |
_hg_status "mar" |
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
154 |
;; |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
155 |
remove) |
1639
dbfc04a55607
_hg_status improvements in bash_completion:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1638
diff
changeset
|
156 |
_hg_status "d" |
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
157 |
;; |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
158 |
forget) |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
159 |
_hg_status "a" |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
160 |
;; |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
161 |
diff) |
1639
dbfc04a55607
_hg_status improvements in bash_completion:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1638
diff
changeset
|
162 |
_hg_status "mar" |
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
163 |
;; |
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
164 |
revert) |
1639
dbfc04a55607
_hg_status improvements in bash_completion:
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1638
diff
changeset
|
165 |
_hg_status "mard" |
935
925563ff1b18
bash: Add smarter completion of add/commit/remove/forget/diff/revert
mpm@selenic.com
parents:
929
diff
changeset
|
166 |
;; |
916 | 167 |
clone) |
168 |
local count=$(_hg_count_non_option) |
|
169 |
if [ $count = 1 ]; then |
|
170 |
_hg_paths |
|
171 |
fi |
|
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
172 |
_hg_repos |
916 | 173 |
;; |
1115
89f54e72581d
bash_completion: add debugindex and debugdata support
mpm@selenic.com
parents:
1018
diff
changeset
|
174 |
debugindex|debugindexdot) |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
175 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -f -X "!*.i" -- "$cur")) |
1115
89f54e72581d
bash_completion: add debugindex and debugdata support
mpm@selenic.com
parents:
1018
diff
changeset
|
176 |
;; |
89f54e72581d
bash_completion: add debugindex and debugdata support
mpm@selenic.com
parents:
1018
diff
changeset
|
177 |
debugdata) |
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
178 |
COMPREPLY=(${COMPREPLY[@]:-} $(compgen -f -X "!*.d" -- "$cur")) |
1115
89f54e72581d
bash_completion: add debugindex and debugdata support
mpm@selenic.com
parents:
1018
diff
changeset
|
179 |
;; |
2039
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
180 |
*) |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
181 |
return 1 |
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
182 |
;; |
916 | 183 |
esac |
184 |
||
2039
0c438fd25e6e
bash_completion: small optimization
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2035
diff
changeset
|
185 |
return 0 |
916 | 186 |
} |
187 |
||
1684
cf930b2452d3
Cleanup of spacing in bash_completion
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1683
diff
changeset
|
188 |
complete -o bashdefault -o default -F _hg hg 2>/dev/null \ |
1153
fa9ae7df88a9
bash_completion: try to use bash3 features if they're available
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
1152
diff
changeset
|
189 |
|| complete -o default -F _hg hg |