diff options
author | 2018-03-02 12:33:51 -0600 | |
---|---|---|
committer | 2018-03-02 12:35:09 -0600 | |
commit | 41d0608e51e5fe3b5034de9ae3700c2490380e2e (patch) | |
tree | 4ebbfbedc53afc3a01f2a03c4cb755cde500a8f8 | |
parent | add completion for emerge --rage-clean (diff) | |
download | gentoo-bashcomp-41d0608e51e5fe3b5034de9ae3700c2490380e2e.tar.gz gentoo-bashcomp-41d0608e51e5fe3b5034de9ae3700c2490380e2e.tar.bz2 gentoo-bashcomp-41d0608e51e5fe3b5034de9ae3700c2490380e2e.zip |
Remove OpenRC completions since they are provided upstreamgentoo-bashcomp-20180302
-rw-r--r-- | completions/rc | 21 | ||||
-rw-r--r-- | completions/rc-service | 111 | ||||
-rw-r--r-- | completions/rc-status | 28 | ||||
-rw-r--r-- | completions/rc-update | 40 |
4 files changed, 0 insertions, 200 deletions
diff --git a/completions/rc b/completions/rc deleted file mode 100644 index 7453ed4..0000000 --- a/completions/rc +++ /dev/null @@ -1,21 +0,0 @@ -# Gentoo Linux Bash Shell Command Completion -# -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -# -# rc completion command -# -_rc() -{ - local cur - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - if [[ ${#COMP_WORDS[*]} -le 2 ]]; then - COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/*; do echo ${i##*/}; done)" -- $cur)) - fi - return 0 -} && -complete -F _rc rc - -# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/rc-service b/completions/rc-service deleted file mode 100644 index 9ad2ce1..0000000 --- a/completions/rc-service +++ /dev/null @@ -1,111 +0,0 @@ -# Gentoo Linux Bash Shell Command Completion -# -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -source "@helpersdir@/gentoo-common.sh" - -_rc_service() { - local cur prev numwords opts - local words i x filename - local action actionpos - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - numwords=${#COMP_WORDS[*]} - - if [[ ${prev} == '>' || ${prev} == '<' ]] ; then - COMPREPLY=($(compgen -f -- ${cur})) - return 0 - fi - - # find action - for x in ${COMP_LINE} ; do - if [[ ${x} =~ --(list|exists|resolve) ]] || \ - [[ ${x} =~ -(l|e|r) ]] - then - action=${x} - break - fi - done - if [[ -n ${action} ]]; then - for ((i = 0; i < ${numwords}; i++ )); do - if [[ ${COMP_WORDS[${i}]} == "${action}" ]]; then - actionpos=${i} - break - fi - done - - for ((i = 1; i < ${numwords}; i++ )); do - if [[ ! ${COMP_WORDS[$i]} == -* ]]; then - break - fi - done - fi - - if [[ ${COMP_CWORD} -eq 3 ]]; then - return 1 - fi - - # check if an option was typed - if [[ ${cur} == -* ]]; then - if [[ ${cur} == --* ]]; then - opts="--list --exists --resolve" - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return 0 - elif [[ ${cur} == -* ]]; then - opts="-l -e -r" - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return 0 - fi - - - # NOTE: This slows things down! - # (Adapted from bash_completion by Ian Macdonald <ian@caliban.org>) - # This removes any options from the list of completions that have - # already been specified on the command line. - COMPREPLY=($(echo "${COMP_WORDS[@]}" | \ - (while read -d ' ' i; do - [[ -z ${i} ]] && continue - # flatten array with spaces on either side, - # otherwise we cannot grep on word boundaries of - # first and last word - COMPREPLY=" ${COMPREPLY[@]} " - # remove word from list of completions - COMPREPLY=(${COMPREPLY/ ${i%% *} / }) - done - echo ${COMPREPLY[@]}))) - - return 0 - # if no option typed - else - if [[ ${COMP_CWORD} -eq 1 ]]; then # if first word typed - words="`rc-service -l | grep ^${cur}`" # complete for init scripts - COMPREPLY=($(for i in ${words} ; do \ - [[ ${i} == ${cur}* ]] && echo ${i} ; \ - done)) - return 0 - elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function - filename=`rc-service -r ${prev}` - opts=`cat ${filename} | grep "^\w*()" | sed "s/().*$//"` # Greps the functions included in the init script - if [[ "x${opts}" == "x" ]] ; then # if no options found loosen the grep algorhythm - opts=`cat ${filename} | grep "\w*()" | sed "s/().*$//"` - fi - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) - return 0 - fi - fi - if [[ ${action} == '--exists' ]] || [[ ${action} == '-e' ]] || \ - [[ ${action} == '--resolve' ]] || [[ ${action} == '-r' ]]; then - words="`rc-service -l | grep ^${cur}`" - COMPREPLY=($(for i in ${words} ; do \ - [[ ${i} == ${cur}* ]] && echo ${i} ; \ - done)) - return 0 - fi - - return 0 -} && -complete -F _rc_service rc-service - -# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/rc-status b/completions/rc-status deleted file mode 100644 index 794067f..0000000 --- a/completions/rc-status +++ /dev/null @@ -1,28 +0,0 @@ -# Gentoo Linux Bash Shell Command Completion -# -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -# -# rc-status completion command -# -_rcstatus() -{ - local cur - cur="${COMP_WORDS[COMP_CWORD]}" - if [[ $COMP_CWORD -eq 1 ]]; then - if [[ "${cur}" == --* ]]; then - COMPREPLY=($(compgen -W '--all --list --unused' -- ${cur})) - elif [[ "${cur}" == -* ]]; then - COMPREPLY=($(compgen -W '-a -l -u' -- ${cur})) - else - COMPREPLY=($(compgen -W "$(rc-status --list)" -- ${cur})) - fi - else - unset COMPREPLY - fi - return 0 -} && -complete -F _rcstatus rc-status - -# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/rc-update b/completions/rc-update deleted file mode 100644 index ae45744..0000000 --- a/completions/rc-update +++ /dev/null @@ -1,40 +0,0 @@ -# Gentoo Linux Bash Shell Command Completion -# -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -# -# rc-update completion command -# -_rcupdate() -{ - local cur show - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - if [[ $COMP_CWORD -eq 1 ]]; then - if [[ "${cur}" == -* ]]; then - COMPREPLY=($(compgen -W '-a -d -s' -- ${cur})) - else - COMPREPLY=($(compgen -W 'add del show' ${cur})) - fi - else - if [[ "${COMP_WORDS[1]}" == "show" ]] || [[ "${COMP_WORDS[1]}" == "-s" ]]; then - show="TRUE" - fi - if ([[ $COMP_CWORD -eq 3 ]] && [[ -z "$show" ]]) || \ - ([[ $COMP_CWORD -eq 2 ]] && [[ -n "$show" ]]) - then - COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/*; do echo ${i##*/}; done)" -- $cur)) - elif [[ $COMP_CWORD -eq 2 ]]; then - COMPREPLY=($(compgen -X "*.@(c|sh|test)" -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/etc/init.d/*; do echo ${i##*/}; done)" $cur)) - elif [[ ${#COMP_WORDS[*]} -gt 2 ]] ; then - COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/*; do echo ${i##*/}; done)" -- $cur)) - else - unset COMPREPLY - fi - fi - return 0 -} && -complete -F _rcupdate rc-update - -# vim: ft=sh:et:ts=4:sw=4:tw=80 |