##// END OF EJS Templates
bash_completion: qguard
Alexis S. L. Carvalho -
r3486:f699d4eb default
parent child Browse files
Show More
@@ -370,6 +370,43 b' complete -o bashdefault -o default -F _h'
370 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$guards' -- "$cur"))
370 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$guards' -- "$cur"))
371 }
371 }
372
372
373 _hg_cmd_qguard()
374 {
375 local prefix=''
376
377 if [[ "$cur" == +* ]]; then
378 prefix=+
379 elif [[ "$cur" == -* ]]; then
380 prefix=-
381 fi
382 local ncur=${cur#[-+]}
383
384 if ! [ "$prefix" ]; then
385 _hg_ext_mq_patchlist qseries
386 return
387 fi
388
389 local guards=$(_hg_ext_mq_guards)
390 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -P $prefix -W '$guards' -- "$ncur"))
391 }
392
393 _hg_opt_qguard()
394 {
395 local i
396 for ((i=cmd_index+1; i<=COMP_CWORD; i++)); do
397 if [[ ${COMP_WORDS[i]} != -* ]]; then
398 if [[ ${COMP_WORDS[i-1]} != @($global_args) ]]; then
399 _hg_cmd_qguard
400 return 0
401 fi
402 elif [ "${COMP_WORDS[i]}" = -- ]; then
403 _hg_cmd_qguard
404 return 0
405 fi
406 done
407 return 1
408 }
409
373
410
374 # hbisect
411 # hbisect
375 _hg_cmd_bisect()
412 _hg_cmd_bisect()
General Comments 0
You need to be logged in to leave comments. Login now