- fix whitespace issues
- sort targets
- drop pmevent
- add pmrep
---
src/bashrc/pcp_completion.sh | 45 ++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/bashrc/pcp_completion.sh b/src/bashrc/pcp_completion.sh
index fe0ce82..27b1b78 100644
--- a/src/bashrc/pcp_completion.sh
+++ b/src/bashrc/pcp_completion.sh
@@ -6,63 +6,64 @@ _pminfo_complete ()
local cur=${COMP_WORDS[$COMP_CWORD]}
local opt_regex= curpos_expand=
- COMPREPLY=()
+ COMPREPLY=()
# Options that need no completion and the cursor position to start
- # expansion from for different programs
+ # expansion from for different programs
case ${COMP_WORDS[0]} in
- pminfo)
- opt_regex="-[abhnOZ]"
- curpos_expand=1
- ;;
- pmprobe)
- opt_regex="-[ahnOZ]"
+ pmdumplog)
+ opt_regex="-[nSTZ]"
curpos_expand=1
;;
- pmdumptext)
+ pmdumptext)
opt_regex="-[AacdfhnOPRsStTUwZ]"
curpos_expand=1
;;
- pmdumplog)
- opt_regex="-[nSTZ]"
+ pminfo)
+ opt_regex="-[abhnOZ]"
curpos_expand=1
;;
- pmlogsummary)
+ pmlogsummary)
opt_regex="-[BnpSTZ]"
curpos_expand=2
;;
- pmstore)
- opt_regex="-[hin]"
+ pmprobe)
+ opt_regex="-[ahnOZ]"
curpos_expand=1
;;
- pmval)
- opt_regex="-[AafhinOpSsTtwZ]"
+ pmrep)
+ opt_regex="-[AabcEeFfhKlOoPqSsTtwyZ]"
curpos_expand=1
;;
- pmevent)
- opt_regex="-[ahKOpSsTtZ]"
+ pmstore)
+ opt_regex="-[hin]"
+ curpos_expand=1
+ ;;
+
+ pmval)
+ opt_regex="-[AafhinOpSsTtwZ]"
curpos_expand=1
;;
esac # --- end of case ---
# We expand either straight from the cursor if it is at the position to
- # expand or check for the preceding options whether to expand or not
+ # expand or check for the preceding options whether to expand or not
if (( $COMP_CWORD == $curpos_expand )) || \
( (( $COMP_CWORD > $curpos_expand )) \
- && ! [[ "${COMP_WORDS[$((COMP_CWORD-1))]}" =~ $opt_regex ]]
+ && ! [[ "${COMP_WORDS[$((COMP_CWORD-1))]}" =~ $opt_regex ]]
)
then
COMPREPLY=(`compgen -W '$(command pminfo)' 2>/dev/null $cur`)
- fi
+ fi
} # ---------- end of function _pminfo_complete ----------
-complete -F _pminfo_complete -o default pminfo pmprobe pmdumptext pmdumplog
pmlogsummary pmstore pmval pmevent
+complete -F _pminfo_complete -o default pmdumplog pmdumptext pminfo
pmlogsummary pmprobe pmrep pmstore pmval
Thanks,
--
Marko Myllynen
|