From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
Date: Fri, 2 Mar 2018 18:35:53 +0000 (UTC) [thread overview]
Message-ID: <1520015709.41d0608e51e5fe3b5034de9ae3700c2490380e2e.williamh@gentoo> (raw)
commit: 41d0608e51e5fe3b5034de9ae3700c2490380e2e
Author: William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 2 18:33:51 2018 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Mar 2 18:35:09 2018 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=41d0608e
Remove OpenRC completions since they are provided upstream
completions/rc | 21 ----------
completions/rc-service | 111 -------------------------------------------------
completions/rc-status | 28 -------------
completions/rc-update | 40 ------------------
4 files changed, 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
next reply other threads:[~2018-03-02 18:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-02 18:35 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-25 16:31 [gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/ Arthur Zamarin
2024-06-07 10:20 Arthur Zamarin
2024-06-07 10:20 Arthur Zamarin
2024-05-27 18:50 Arthur Zamarin
2024-05-22 5:08 Arthur Zamarin
2024-05-22 4:53 Arthur Zamarin
2024-05-21 19:25 Arthur Zamarin
2024-05-21 19:18 Arthur Zamarin
2024-05-21 18:34 Arthur Zamarin
2024-05-21 17:50 Arthur Zamarin
2024-05-15 20:09 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-15 19:25 Arthur Zamarin
2024-05-11 3:12 Sam James
2024-05-11 3:12 Sam James
2024-02-25 20:14 Sam James
2024-02-21 7:34 Sam James
2024-02-21 7:34 Sam James
2024-02-21 7:34 Sam James
2024-02-21 7:23 Sam James
2023-03-13 21:27 Sam James
2023-01-14 16:38 Sam James
2018-06-23 22:23 Patrice Clement
2018-03-02 18:06 Michał Górny
2018-03-02 18:06 Michał Górny
2018-03-02 18:06 Michał Górny
2014-08-31 21:19 ` Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520015709.41d0608e51e5fe3b5034de9ae3700c2490380e2e.williamh@gentoo \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox