comparison contrib/bash_completion @ 9460:552c5a5a3502

contrib/bash_completion: add tab completion for some bookmark commands
author Steve Losh <steve@stevelosh.com>
date Thu, 17 Sep 2009 22:30:45 -0400
parents b5e9ed63913b
children fc493cb90bb1
comparison
equal deleted inserted replaced
9459:3b283adcc720 9460:552c5a5a3502
275 complete -o bashdefault -o default -F _hg hg 2>/dev/null \ 275 complete -o bashdefault -o default -F _hg hg 2>/dev/null \
276 || complete -o default -F _hg hg 276 || complete -o default -F _hg hg
277 277
278 278
279 # Completion for commands provided by extensions 279 # Completion for commands provided by extensions
280
281 # bookmarks
282 _hg_bookmarks()
283 {
284 local bookmarks="$("$hg" bookmarks --quiet 2>/dev/null )"
285 local IFS=$'\n'
286 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$bookmarks' -- "$cur"))
287 }
288
289 _hg_cmd_bookmarks()
290 {
291 if [[ "$prev" = @(-d|--delete|-m|--rename) ]]; then
292 _hg_bookmarks
293 return
294 fi
295 }
280 296
281 # mq 297 # mq
282 _hg_ext_mq_patchlist() 298 _hg_ext_mq_patchlist()
283 { 299 {
284 local patches 300 local patches