1 # Programmable completion for Performance Co-Pilot commands under bash.
4 local cur
=${COMP_WORDS[$COMP_CWORD]}
10 # Options that need no completion and the cursor position to start
11 # expansion from for different programs
12 case ${COMP_WORDS[0]} in
20 opt_regex
="-[AacdfhnOPRsStTUwZ]"
25 opt_regex
="-[AafhinOpSsTtwZ]"
45 opt_regex
="-[AaBbcCdDeEfFGhHiKLloOpPqQrsStTuUVwxyYzZ]"
55 opt_regex
="-[AafhinOpSsTtwZ]"
59 esac # --- end of case ---
61 # We expand either straight from the cursor if it is at the position to
62 # expand or check for the preceding options whether to expand or not
63 if (( $COMP_CWORD == $curpos_expand )) || \
64 ( (( $COMP_CWORD > $curpos_expand )) \
65 && ! [[ "${COMP_WORDS[$((COMP_CWORD-1))]}" =~
$opt_regex ]]
68 COMPREPLY
=(`compgen -W '$(command pminfo)' 2>/dev/null $cur`)
71 } # ---------- end of function _pcp_complete ----------
73 complete
-F _pcp_complete
-o default pmdumplog pmdumptext pmevent pminfo pmlogsummary pmprobe pmrep pmstore pmval