[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 20b9dd7d3e216bc07b5209f4f131e29b01363bf5 Author: Arthur Zamarin gentoo org> AuthorDate: Tue Jun 25 16:31:30 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Tue Jun 25 16:31:30 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=20b9dd7d add completion for quickpkg Signed-off-by: Arthur Zamarin gentoo.org> completions/quickpkg | 39 +++ 1 file changed, 39 insertions(+) diff --git a/completions/quickpkg b/completions/quickpkg new file mode 100644 index 000..e5e826e --- /dev/null +++ b/completions/quickpkg @@ -0,0 +1,39 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# quickpkg completion (from sys-apps/portage) +# + +_quickpkg() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local OPTS=( +-h --help --umask --ignore-default-opts --include-config +--include-unmodified-config +) + +case ${prev} in +--umask) +COMPREPLY=() +return +;; +--include-config|--include-unmodified-config) +COMPREPLY=( $(compgen -W 'y n' -- "${cur}") ) +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname -I "${cur}" +fi +} && +complete -F _quickpkg quickpkg + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 5da9b01ff0e33cf0d34feda669045f42d201cd8c Author: Arthur Zamarin gentoo org> AuthorDate: Fri Jun 7 10:20:22 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Fri Jun 7 10:20:22 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=5da9b01f add completion for binutils-config Signed-off-by: Arthur Zamarin gentoo.org> completions/binutils-config | 45 + 1 file changed, 45 insertions(+) diff --git a/completions/binutils-config b/completions/binutils-config new file mode 100644 index 000..ab7fa90 --- /dev/null +++ b/completions/binutils-config @@ -0,0 +1,45 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# binutils-config completion (from sys-devel/binutils-config) +# +_binutils-config() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} +local OPTS=( +-C --nocolor +-c --get-current-profile +-l --list-profiles +-u --uninstall +-d --debug +-B --get-bin-path +-L --get-lib-path +) +_list_profiles() { +binutils-config --nocolor --list-profiles 2>/dev/null | \ +sed -r -e 's/\[([^]]*)\] //g' -e 's/ \*//g' +} + +if [[ ${cur} == -* ]] ; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +return 0 +elif [[ ${COMP_CWORD} -eq 1 ]] ; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +COMPREPLY+=( $(compgen -W '$(_list_profiles)' -- "${cur}" )) +return 0 +fi + +case ${prev} in +-c|--get-current-profile|-l|--list-profiles) +COMPREPLY=() +;; +*) +COMPREPLY=( $(compgen -W '$(_list_profiles)' -- "${cur}") ) +;; +esac +} && +complete -F _binutils-config binutils-config + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 90dceec2bd0941e9a31fe0b906bdc283869dbca9 Author: Arthur Zamarin gentoo org> AuthorDate: Fri Jun 7 10:16:04 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Fri Jun 7 10:16:04 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=90dceec2 gcc-config: fix invalid suggestions & add missing flags It was using the colored output and the "*" as completion options, which was causing weird suggestions. Signed-off-by: Arthur Zamarin gentoo.org> completions/gcc-config | 48 ++-- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/completions/gcc-config b/completions/gcc-config index b0d0800..40d8415 100644 --- a/completions/gcc-config +++ b/completions/gcc-config @@ -1,42 +1,46 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later # -# gcc-config completion command +# gcc-config completion (from sys-devel/gcc-config) # _gcc_config() { -local cur prev opts -COMPREPLY=() -cur="${COMP_WORDS[COMP_CWORD]}" -prev="${COMP_WORDS[COMP_CWORD-1]}" -opts="-O --use-old \ --P --use-portage-chost \ --c --get-current-profile \ --l --list-profiles \ --E --print-environ \ --B --get-bin-path \ --L --get-lib-path \ --X --get-stdcxx-incdir" +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} +local OPTS=( +-C --nocolor +-O --use-old +-f --force +-P --use-portage-chost +-c --get-current-profile +-l --list-profiles +-S --split-profile +-E --print-environ +-B --get-bin-path +-L --get-lib-path +-X --get-stdcxx-incdir +) +_list_profiles() { +gcc-config --nocolor --list-profiles 2>/dev/null | \ +sed -r -e 's/\[([^]]*)\] //g' -e 's/ \*//g' +} -if [[ "${cur}" == -* ]] ; then -COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) +if [[ ${cur} == -* ]] ; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) return 0 elif [[ ${COMP_CWORD} -eq 1 ]] ; then -COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) \ -$(compgen -W "$(gcc-config -l | sed -r -e 's/(\[([^]]*)\]) //g')" \ --- ${cur}) ) +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +COMPREPLY+=( $(compgen -W '$(_list_profiles)' -- "${cur}" )) return 0 fi -case "${prev}" in +case ${prev} in -O|--use-old|-P|--use-portage-chost|-c|--get-current-profile|-l|--list-profiles) COMPREPLY=() ;; *) -COMPREPLY=( $(compgen -W "\ -$(gcc-config -l | sed -r -e 's/(\[([^]]*)\]) //g')" -- ${cur}) ) +COMPREPLY=( $(compgen -W '$(_list_profiles)' -- "${cur}") ) ;; esac } &&
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 346a97f0c7fd72a29a8c6507adf6fa2e25676ca4 Author: Arthur Zamarin gentoo org> AuthorDate: Mon May 27 18:50:17 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Mon May 27 18:50:17 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=346a97f0 add completion for perl-cleaner from app-admin/perl-cleaner Based on code from Michal Privoznik gmail.com> Closes: https://github.com/gentoo-perl/perl-cleaner/pull/10 Signed-off-by: Arthur Zamarin gentoo.org> completions/perl-cleaner | 41 + 1 file changed, 41 insertions(+) diff --git a/completions/perl-cleaner b/completions/perl-cleaner new file mode 100644 index 000..a4cf9fd --- /dev/null +++ b/completions/perl-cleaner @@ -0,0 +1,41 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# perl-cleaner completion (from app-admin/perl-cleaner) +# + +_perl_cleaner() { +local i cur prev +_get_comp_words_by_ref cur prev + +local OPTS=( +-h --help -V --version -p --pretend -v --verbose -q --quite +--modules --allmodules --libperl --all --reallyall +--dont-delete-leftovers -P --package-manager +) + +for (( i=1; i < COMP_CWORD; i++ )); do +if [[ ${COMP_WORDS[i]} == -- ]]; then +local root_command=emerge +_command_offset ${i} +return +fi +done + +case ${prev} in +-P|--package-manager) +COMPREPLY=($(compgen -W 'portage pkgcore paludis' -- "${cur}")) +return 0 +;; +esac + +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +return 0 + +} && +complete -F _perl_cleaner perl-cleaner + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: 0430b6d232abcd98de7d6a4246db2bbb0d96446a Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 25 07:54:24 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Sat May 25 07:54:24 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=0430b6d2 Makefile: remove legacy dist rules Signed-off-by: Arthur Zamarin gentoo.org> Makefile | 13 - 1 file changed, 13 deletions(-) diff --git a/Makefile b/Makefile index 5947e9e..9302f35 100644 --- a/Makefile +++ b/Makefile @@ -45,16 +45,3 @@ tag: @echo @echo "created tag $(distpkg) - remember to push it" @echo - -dist: tag - git archive --prefix=$(distpkg)/ --format=tar -o $(distpkg).tar $(distpkg) - mkdir $(distpkg)/ - git log > $(distpkg)/ChangeLog - tar vfr $(distpkg).tar $(distpkg)/ChangeLog - xz $(distpkg).tar - rm -rf $(distpkg)/ - @echo "success." - -dist-upload: dist - scp $(distpkg).tar.xz dev.gentoo.org:/space/distfiles-local/ - ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.xz
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 3c6e22334e041e6816e0e069e94f8d77da078631 Author: Arthur Zamarin gentoo org> AuthorDate: Wed May 22 05:07:58 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 22 05:07:58 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=3c6e2233 ebuild: fix, refactor and update completion Closes: https://bugs.gentoo.org/403123 Signed-off-by: Arthur Zamarin gentoo.org> completions/ebuild | 35 ++- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/completions/ebuild b/completions/ebuild index a268355..b86eee8 100644 --- a/completions/ebuild +++ b/completions/ebuild @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later # @@ -8,25 +8,26 @@ # _ebuild() { -local cur opts -COMPREPLY=() -cur="${COMP_WORDS[COMP_CWORD]}" +local i noopts seenf cur=${COMP_WORDS[COMP_CWORD]} +local cmds=( +help setup clean fetch digest manifest unpack compile test preinst +install postinst qmerge merge unmerge prerm postrm config package rpm +configure prepare instprep +) +local opts=( --debug --force --ignore-default-opts --skip-manifest --help ) -opts="help setup clean fetch digest manifest unpack compile test preinst \ -install postinst qmerge merge unmerge prerm postrm config package rpm \ -configure prepare" +for (( i=1 ; i < ${COMP_CWORD} ; i++ )) ; do +[[ ${noopts} || ${COMP_WORDS[$i]/#-*} ]] && seenf=1 +[[ ${COMP_WORDS[$i]} == "--" ]] && noopts=1 +done -if [[ $COMP_CWORD -eq 1 ]] ; then -COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) \ -$(compgen -d -- ${cur}) \ -$(compgen -W '--debug --force --help --ignore-default-opts --skip-manifest' -- ${cur})) - -elif [[ $COMP_CWORD -eq 2 && "${COMP_WORDS[1]}" = "--debug --force --ignore-default-opts --skip-manifest" ]] ; then -COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur})) - -elif [[ $COMP_CWORD -ge 2 ]] ; then -COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +if [[ ${seenf} ]] ; then +COMPREPLY=( $(compgen -W '${cmds[*]}' -- "${cur}") ) +else +_filedir ebuild fi + +[[ ${noopts} ]] || COMPREPLY+=( $(compgen -W '${opts[*]}' -- "${cur}") ) return 0 } && complete -o filenames -F _ebuild ebuild
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: b812d24b004dff668f4321c51124ef086a0e506e Author: Arthur Zamarin gentoo org> AuthorDate: Wed May 22 04:53:29 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 22 04:53:29 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=b812d24b glsa-check: add missing args Signed-off-by: Arthur Zamarin gentoo.org> completions/glsa-check | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/completions/glsa-check b/completions/glsa-check index d985429..b1ef0f1 100644 --- a/completions/glsa-check +++ b/completions/glsa-check @@ -4,29 +4,28 @@ # Distributed under the terms of the GNU General Public License, v2 or later _glsa_check() { -local cur opts COMPREPLY=() -cur="${COMP_WORDS[COMP_CWORD]}" -opts="-l --list -d --dump --print -t --test -p --pretend -f --fix -i +local cur="${COMP_WORDS[COMP_CWORD]}" +local opts="-l --list -d --dump --print -t --test -p --pretend -f --fix -i --inject -n --nocolor -e --emergelike -h --help -V --version -v --verbose --c --cve -m --mail" +-c --cve -m --mail -q --quiet -r --reverse" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then -COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) return 0 fi # too slow otherwise -if [[ ! -f ${ROOT}/tmp/gc.out ]] || \ -[[ $(stat ${ROOT}/tmp/gc.out | \ -sed -n -e 's/^Modify: \([[:digit:]]\+-[[:digit:]]\+-[[:digit:]]\+\).*$/\1/p') != "$(date +%F)" ]] +local cache_file=${ROOT}/tmp/.completion.glsa-check.cache +if [[ ! -f ${cache_file} ]] || \ +(( $(date +%s) - $(stat -c %Y "${cache_file}") > 4 * 3600 )) then glsa-check -nl 2>/dev/null | \ sed -n -e 's/^\([[:digit:]]\+-[[:digit:]]\+\) .*$/\1/p' > \ -${ROOT}/tmp/gc.out +"${cache_file}" fi -COMPREPLY=($(compgen -W "${opts} $(< ${ROOT}/tmp/gc.out)" -- ${cur})) +COMPREPLY=($(compgen -W "${opts} all new affected $(< "${cache_file}")" -- "${cur}")) } && complete -F _glsa_check glsa-check
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 725f857724ac06277423688c3f6ca8f4ea15334f Author: Arthur Zamarin gentoo org> AuthorDate: Tue May 21 19:25:11 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Tue May 21 19:25:11 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=725f8577 add completion for eshowkw from app-portage/gentoolkit Closes: https://bugs.gentoo.org/426570 Signed-off-by: Arthur Zamarin gentoo.org> completions/eshowkw | 45 + 1 file changed, 45 insertions(+) diff --git a/completions/eshowkw b/completions/eshowkw new file mode 100644 index 000..8420420 --- /dev/null +++ b/completions/eshowkw @@ -0,0 +1,45 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# eshowkw completion (from app-portage/gentoolkit) +# + +_eshowkw() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-h --help -v --version -B --bold -C --color -O --overlays +-P --prefix -S --ignore-slot' +[ARG]='-a --arch -A --align -T --top-position' +) + +case ${prev} in +-a|--arch) +local portdir=$(_portdir) +COMPREPLY=($(compgen -W "$( grep -v \# < "${portdir}/profiles/arch.list" )" -- "${cur}")) +return +;; +-A|--align) +COMPREPLY=($(compgen -W "top bottom" -- "${cur}")) +return +;; +-T|--top-position) +COMPREPLY=($(compgen -W "archlist versionlist" -- "${cur}")) +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname -A "${cur}" +fi +} && +complete -F _eshowkw eshowkw + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 7fac21ea09db60e625ed47c95327836230873192 Author: Arthur Zamarin gentoo org> AuthorDate: Tue May 21 19:18:26 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Tue May 21 19:18:26 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=7fac21ea layman: optimize speed Closes: https://bugs.gentoo.org/526614 Signed-off-by: Arthur Zamarin gentoo.org> completions/layman | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/completions/layman b/completions/layman index c634b13..e5441ac 100644 --- a/completions/layman +++ b/completions/layman @@ -10,20 +10,21 @@ _layman() { -local cur prev opts r_overlays l_overlays splitopt +local cur prev r_overlays COMPREPLY=() -opts="--version -h --help -a --add -d --delete -s --sync -i --info +local opts=( +--version -h --help -a --add -d --delete -s --sync -i --info -S --sync-all -L --list -l --list-local -n --nofetch -p --priority -c --config -O --overlay_defs -o --overlays -v --verbose -q --quiet --N --nocolor -Q --quietness -W --width -k --nocheck --debug-level" -r_overlays="$(layman -LkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3)" -l_overlays="$(layman -lkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3)" -splitopt=false +-N --nocolor -Q --quietness -W --width -k --nocheck --debug-level +) +r_overlays() { layman -LkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3; } +l_overlays() { layman -lkNq 2>/dev/null | grep -v '^$' | cut -d' ' -f3; } _get_comp_words_by_ref -n = cur prev -_split_longopt && splitopt=true +_split_longopt && local splitopt=1 case ${prev} in --version|-h|--help|-W|--width|-o|--overlays) @@ -31,15 +32,16 @@ _layman() { return 0 ;; -a|--add|-i|--info) -COMPREPLY=( $(compgen -W "${r_overlays}" -- "${cur}") ) +COMPREPLY=( $(compgen -W "$(r_overlays)" -- "${cur}") ) return 0 ;; -d|--delete) -COMPREPLY=( $(compgen -W "${l_overlays}" -- "${cur}") ) +COMPREPLY=( $(compgen -W "$(l_overlays)" -- "${cur}") ) return 0 ;; -s|--sync) -COMPREPLY=( $(compgen -W "${l_overlays} ALL" -- "${cur}") ) +COMPREPLY=( $(compgen -W "$(l_overlays)" -- "${cur}") ) +COMPREPLY+=( $(compgen -W "ALL" -- "${cur}") ) return 0 ;; -p|--priority) @@ -61,9 +63,9 @@ _layman() { ;; esac -$splitopt && return 0 +[[ -n ${splitopt} ]] && return 0 -COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) +COMPREPLY=( $(compgen -W '${opts[*]}' -- "${cur}") ) } && complete -F _layman layman
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: a5fbc58454e6cd8544096b1def1f7c30f45e97c1 Author: Arthur Zamarin gentoo org> AuthorDate: Tue May 21 18:34:11 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Tue May 21 18:34:41 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=a5fbc584 emerge: use array for opts & format the code Closes: https://bugs.gentoo.org/924830 Signed-off-by: Arthur Zamarin gentoo.org> completions/emerge | 144 +++-- 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/completions/emerge b/completions/emerge index 342bfc4..32a1da9 100644 --- a/completions/emerge +++ b/completions/emerge @@ -10,16 +10,16 @@ source "@helpersdir@/gentoo-common.sh" # _emerge() { -local c cur prev curword numwords opts cond prepend +local c cur prev cond prepend local words stophere i x local action actionpos sysactions pkgpos local portdir=$(_portdir -o) COMPREPLY=() -cur="${COMP_WORDS[COMP_CWORD]}" -prev="${COMP_WORDS[COMP_CWORD-1]}" -numwords=${#COMP_WORDS[*]} -curword=${COMP_CWORD} -opts='' +local cur=${COMP_WORDS[COMP_CWORD]} +local prev=${COMP_WORDS[COMP_CWORD-1]} +local numwords=${#COMP_WORDS[*]} +local curword=${COMP_CWORD} +local opts=() if [[ ${prev} == '>' || ${prev} == '<' ]] ; then COMPREPLY=($(compgen -f -- ${cur})) @@ -86,69 +86,71 @@ _emerge() # If a resume option was specified, it needs special handling. if [[ ${COMP_LINE} =~ --(resume|skipfirst) ]] ; then if [[ ${cur} == --* ]]; then -opts="--ask --pretend --resume --skipfirst" +opts=( --ask --pretend --resume --skipfirst ) elif [[ ${cur} == -* ]]; then -[[ ${COMP_LINE} =~ --(ask|pretend) ]] && opts="-a -p" +[[ ${COMP_LINE} =~ --(ask|pretend) ]] && opts=( -a -p ) fi elif [[ ${cur} == --* ]]; then # Complete on long options. -opts="--alphabetical \ ---ask \ ---autounmask-write --autounmask-keep-keywords --autounmask-continue \ ---autounmask-backtrack --autounmask-only --autounmask-unrestricted-atoms \ ---autounmask-keep-masks --autounmask-license --autounmask-use \ ---accept-properties --accept-restrict --alert --alert=y --alert=n \ ---ask-enter-invalid \ ---binpkg-changed-deps --binpkg-respect-use \ ---buildpkg-exclude \ ---buildpkg --buildpkgonly \ ---backtrack= \ ---changelog --clean --color=y --color=n --columns --complete-graph --config --check-news \ ---complete-graph-if-new-use --complete-graph-if-new-ver \ ---config-root \ ---changed-deps --changed-deps-report --changed-slot --changed-use \ ---debug --deep --depclean --deselect \ ---depclean-lib-check \ ---dynamic-deps --dynamic-deps=y --dynamic-deps=n \ ---emptytree \ ---exclude \ ---fail-clean --fetch-all-uri --fetchonly --fuzzy-search \ ---getbinpkg --getbinpkgonly \ ---ignore-default-opts --ignore-built-slot-operator-deps --ignore-soname-deps \ ---ignore-world --implicit-system-deps --info \ ---jobs= --load-average= \ ---keep-going \ ---misspell-suggestions --metadata \ ---newrepo --newuse --noconfmem --nodeps --noreplace --nospinner \ ---oneshot --onlydeps --onlydeps-with-ideps --onlydeps-with-rdeps \ ---pretend --prune --package-moves --pkg-format \ ---quiet --quiet-build --quiet-fail --quiet-repo-display --quiet-unmerge-warn \ ---rage-clean --regex-search-auto --read-news \ ---reinstall=changed-use --reinstall-atoms --regen --rebuild-exclude --rebuild-ignore --rebuild-if-new-slot \ ---rebuild-if-new-rev --rebuild-if-new-ver --rebuild-if-unbuilt --rebuilt-binaries \ ---search --search-index --search-similarity \ ---sync --select --selective \ ---sync-submodule=glsa --sync-submodule=news --sync-submodule=profiles \ ---tree \ ---unordered-display --use-ebuild-visibility --useoldpkg-atoms --usepkg-exclude-live \ ---unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly --usepkg-exclude \ ---verbose --verbose-conflicts --verbose-slot-rebuilds \ ---with-bdeps=y --with-bdeps=n --with-bdeps-auto --with-test-deps" +opts=( +--alphabetical +--ask +--autounmask-write --autounmask-keep-keywords --autounmask-continue={y,n} +
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: d770066407985fbf40608f09d84f77ab23516646 Author: Arthur Zamarin gentoo org> AuthorDate: Tue May 21 17:50:51 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Tue May 21 17:50:51 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=d7700664 update completion of emerge Signed-off-by: Arthur Zamarin gentoo.org> completions/emerge | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/completions/emerge b/completions/emerge index 2268fca..342bfc4 100644 --- a/completions/emerge +++ b/completions/emerge @@ -103,7 +103,7 @@ _emerge() --buildpkg-exclude \ --buildpkg --buildpkgonly \ --backtrack= \ ---changelog --clean --color=y --color=n --columns --complete-graph --config \ +--changelog --clean --color=y --color=n --columns --complete-graph --config --check-news \ --complete-graph-if-new-use --complete-graph-if-new-ver \ --config-root \ --changed-deps --changed-deps-report --changed-slot --changed-use \ @@ -112,23 +112,28 @@ _emerge() --dynamic-deps --dynamic-deps=y --dynamic-deps=n \ --emptytree \ --exclude \ ---fetch-all-uri --fetchonly \ +--fail-clean --fetch-all-uri --fetchonly --fuzzy-search \ --getbinpkg --getbinpkgonly \ ---ignore-default-opts --info \ ---jobs= \ +--ignore-default-opts --ignore-built-slot-operator-deps --ignore-soname-deps \ +--ignore-world --implicit-system-deps --info \ +--jobs= --load-average= \ --keep-going \ ---metadata \ ---newuse --noconfmem --nodeps --noreplace --nospinner \ +--misspell-suggestions --metadata \ +--newrepo --newuse --noconfmem --nodeps --noreplace --nospinner \ --oneshot --onlydeps --onlydeps-with-ideps --onlydeps-with-rdeps \ ---pretend --prune \ ---quiet --rage-clean \ ---reinstall=changed-use --regen \ ---search \ ---sync \ +--pretend --prune --package-moves --pkg-format \ +--quiet --quiet-build --quiet-fail --quiet-repo-display --quiet-unmerge-warn \ +--rage-clean --regex-search-auto --read-news \ +--reinstall=changed-use --reinstall-atoms --regen --rebuild-exclude --rebuild-ignore --rebuild-if-new-slot \ +--rebuild-if-new-rev --rebuild-if-new-ver --rebuild-if-unbuilt --rebuilt-binaries \ +--search --search-index --search-similarity \ +--sync --select --selective \ +--sync-submodule=glsa --sync-submodule=news --sync-submodule=profiles \ --tree \ ---unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly \ ---verbose --verbose-conflicts \ ---with-bdeps=y --with-bdeps=n --with-test-deps" +--unordered-display --use-ebuild-visibility --useoldpkg-atoms --usepkg-exclude-live \ +--unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly --usepkg-exclude \ +--verbose --verbose-conflicts --verbose-slot-rebuilds \ +--with-bdeps=y --with-bdeps=n --with-bdeps-auto --with-test-deps" if [[ ${curword} -eq 1 ]] && [[ ${numwords} -eq 2 ]] ; then opts="${opts} --help --resume --searchdesc --version" fi
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 03984b3ea6dea163773af007c7109636a9676e9e Author: Arthur Zamarin gentoo org> AuthorDate: Wed May 15 20:09:45 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 20:09:45 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=03984b3e add completion for emaint from sys-apps/portage Signed-off-by: Arthur Zamarin gentoo.org> completions/emaint | 77 ++ 1 file changed, 77 insertions(+) diff --git a/completions/emaint b/completions/emaint new file mode 100644 index 000..74f1e0a --- /dev/null +++ b/completions/emaint @@ -0,0 +1,77 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# emaint completion (from sys-apps/portage) +# + +_emaint() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[COMMANDS]='all binhost cleanresume merges movebin moveinst sync world' +[STANDALONE]='-h --help -c --check -f --fix --version' +[LOGS]='-C --clean -p --pretend' +[LOGS_ARG]='-t --time' +[MERGES]='-y --yes' +[SYNC]='-a --auto -A --allrepos' +[SYNC_ARG]='-r --repo --sync-submodule' +) + +local i command +for (( i=1; i <= COMP_CWORD; i++ )); do +if [[ ${COMP_WORDS[i]} != -* ]]; then +if [[ " ${OPTS[COMMANDS]} " =~ " ${COMP_WORDS[i]} " ]]; then +command=${COMP_WORDS[i]} +break +else +COMPREPLY=( $(compgen -W '${OPTS[COMMANDS]}' -- "${cur}") ) +return +fi +fi + +[[ ${i} -lt ${COMP_CWORD} && " ${OPTS[LOGS_ARG]} ${OPTS[SYNC_ARG]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) +done + +case ${command} in +logs) +if [[ ${prev} = -t || ${prev} = --time ]]; then +COMPREPLY=() +return +fi +;; +sync) +case ${prev} in +-r|--repo) +COMPREPLY=( $(compgen -W "$(_parsereposconf -l)" -- "${cur}") ) +return +;; +--sync-submodule) +COMPREPLY=( $(compgen -W 'glsa news profiles' -- "${cur}") ) +return +;; +esac +;; +esac + +COMPREPLY=( $(compgen -W '${OPTS[STANDALONE]}' -- "${cur}") ) +case ${command} in +logs) +COMPREPLY+=( $(compgen -W '${OPTS[LOGS]} ${OPTS[LOGS_ARG]}' -- "${cur}") ) +;; +merges) +COMPREPLY+=( $(compgen -W '${OPTS[MERGES]}' -- "${cur}") ) +;; +sync) +COMPREPLY+=( $(compgen -W '${OPTS[SYNC]} ${OPTS[SYNC_ARG]}' -- "${cur}") ) +;; +esac +if [[ -z ${command} ]]; then +COMPREPLY+=( $(compgen -W '${OPTS[COMMANDS]}' -- "${cur}") ) +fi +} && +complete -F _emaint emaint + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: bfa68e78a658e1af098931dfc2ebf69bee61265f Author: Arthur Zamarin gentoo org> AuthorDate: Wed May 15 19:15:36 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:15:36 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=bfa68e78 add completion for qkeyword from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qkeyword | 37 + 1 file changed, 37 insertions(+) diff --git a/completions/qkeyword b/completions/qkeyword new file mode 100644 index 000..ebf749c --- /dev/null +++ b/completions/qkeyword @@ -0,0 +1,37 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# qkeyword completion (from app-portage/portage-utils) +# + +_qkeyword() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-A --showarch -i --showarch -d --showarch -t --needsstable +-s --stats -a --all -n --not -S --stable -T --testing +-v --verbose -q --quiet -C --nocolor --color -h --help -V --version' +[ARG]='-p --matchpkg -c --matchcat -m --matchmaint -F --format --root' +) + +case ${prev} in +--root) +_filedir -d +return +;; +-p|--matchpkg|-c|--matchcat|-m|--matchmaint|-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +fi +} && +complete -F _qkeyword qkeyword + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: a338e2564a05127c7aa6f3170d2de3fa305a0655 Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 11 19:38:17 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:53 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=a338e256 add completion for qdepends from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qdepends | 49 + 1 file changed, 49 insertions(+) diff --git a/completions/qdepends b/completions/qdepends new file mode 100644 index 000..0c6111d --- /dev/null +++ b/completions/qdepends @@ -0,0 +1,49 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# qdepends completion (from app-portage/portage-utils) +# + +_qdepends() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-d --depend -r --rdepend -p --pdepend -b --bdepend -I --idepend +-Q --query -i --installed -t --tree -U --use -S --pretty -R --resolve +-v --verbose -q --quiet -C --nocolor --color -h --help -V --version' +[ARG]='-F --format --root' +) + +local i pkg_type="-I" +for word in "${COMP_WORDS[@]}"; do +if [[ ${word} = "-t" || ${word} = "--tree" ]]; then +pkg_type="-A" +break +fi +done + +case ${prev} in +--root) +_filedir -d +return +;; +-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname ${pkg_type} "${cur}" +fi +} && +complete -F _qdepends qdepends + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 0e7fa26783d4c33346703a2ef25e56342ddac9fd Author: Arthur Zamarin gentoo org> AuthorDate: Sun May 12 16:16:23 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:54 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=0e7fa267 add completion for qsearch from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qsearch | 36 1 file changed, 36 insertions(+) diff --git a/completions/qsearch b/completions/qsearch new file mode 100644 index 000..4cae9d2 --- /dev/null +++ b/completions/qsearch @@ -0,0 +1,36 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# qsearch completion (from app-portage/portage-utils) +# + +_qsearch() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-a --all -s --search -N --name-only -R --repo +-v --verbose -q --quiet -C --nocolor --color -h --help -V --version' +[ARG]='-S --desc -F --format --root' +) + +case ${prev} in +--root) +_filedir -d +return +;; +-S|--desc|-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +fi +} && +complete -F _qsearch qsearch + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 6c1315e121cb90a28c6fcd00bd10eff2f527238c Author: Arthur Zamarin gentoo org> AuthorDate: Sun May 12 16:00:47 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:54 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=6c1315e1 add completion for qwhich from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qwhich | 49 + 1 file changed, 49 insertions(+) diff --git a/completions/qwhich b/completions/qwhich new file mode 100644 index 000..87959b9 --- /dev/null +++ b/completions/qwhich @@ -0,0 +1,49 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# qwhich completion (from app-portage/portage-utils) +# + +_qwhich() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-I --vdb -b --binpkg -t --tree -p --pretty -d --dir +-R --repo -f --first -l --latest -T --novirtual -A --noacct +-v --verbose -q --quiet -C --nocolor --color -h --help -V --version' +[ARG]='-F --format --root' +) + +local i pkg_type="-I" +for word in "${COMP_WORDS[@]}"; do +if [[ ${word} = "-t" || ${word} = "--tree" ]]; then +pkg_type="-A" +break +fi +done + +case ${prev} in +--root) +_filedir -d +return +;; +-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname ${pkg_type} "${cur}" +fi +} && +complete -F _qwhich qwhich + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: a7e145507c10aad145281eea418ce3ee00bb5121 Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 11 16:01:12 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:53 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=a7e14550 add completion for qlist from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qlist | 42 ++ 1 file changed, 42 insertions(+) diff --git a/completions/qlist b/completions/qlist new file mode 100644 index 000..1c4c24f --- /dev/null +++ b/completions/qlist @@ -0,0 +1,42 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# qlist completion (from app-portage/portage-utils) +# + +_qlist() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-I --installed -k --binpkgs -t --tree -S --slots -R --repo +-U --umap -c --columns -m --mask --showdebug -e --exact -d --dir +-o --obj -s --sym -v --verbose -q --quiet -C --nocolor --color +-h --help -V --version' +[ARG]='-F --format --root' +) + +case ${prev} in +--root) +_filedir -d +return +;; +-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname -I "${cur}" +fi +} && +complete -F _qlist qlist + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: d4ecc657ba65202265d8757478192e273c09b135 Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 11 20:03:24 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:54 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=d4ecc657 add completion for qsize from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qsize | 41 + 1 file changed, 41 insertions(+) diff --git a/completions/qsize b/completions/qsize new file mode 100644 index 000..34d1fec --- /dev/null +++ b/completions/qsize @@ -0,0 +1,41 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# qsize completion (from app-portage/portage-utils) +# + +_qsize() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-f --filesystem -s --sum -S --sum-only -m --megabytes +-k --kilobytes -b --bytes -v --verbose -q --quiet -C --nocolor +--color -h --help -V --version' +[ARG]='-i --ignore -F --format --root' +) + +case ${prev} in +--root) +_filedir -d +return +;; +-i|--ignore|-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_pkgname -I "${cur}" +fi +} && +complete -F _qsize qsize + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 3d2b3aa2fe7d534a9d17a362989f6800efd36402 Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 11 19:26:07 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:53 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=3d2b3aa2 add completion for qfile from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/qfile | 45 + 1 file changed, 45 insertions(+) diff --git a/completions/qfile b/completions/qfile new file mode 100644 index 000..edf9e08 --- /dev/null +++ b/completions/qfile @@ -0,0 +1,45 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +source "@helpersdir@/gentoo-common.sh" + +# +# qfile completion (from app-portage/portage-utils) +# + +_qfile() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-S --slots -R --root-prefix -d --dir -o --orphans +-P --skip-plibreg --verbose -q --quiet -C --nocolor --color +-h --help -V --version' +[ARG]='-F --format -x --exclude --root' +) + +case ${prev} in +--root) +_filedir -d +return +;; +-x|--exclude) +_pkgname -I "${cur}" +return +;; +-F|--format) +COMPREPLY=() +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "${cur}") ) +else +_filedir +fi +} && +complete -F _qfile qfile + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 114d592416f604caf28cfc53ce6dfb1aa1c00b72 Author: Arthur Zamarin gentoo org> AuthorDate: Sat May 11 16:01:44 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Wed May 15 19:10:53 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=114d5924 add completion for q from app-portage/portage-utils Signed-off-by: Arthur Zamarin gentoo.org> completions/q | 52 1 file changed, 52 insertions(+) diff --git a/completions/q b/completions/q new file mode 100644 index 000..1522235 --- /dev/null +++ b/completions/q @@ -0,0 +1,52 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# q completion (from app-portage/portage-utils) +# + +_q() { +local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} + +local -A OPTS=( +[STANDALONE]='-i --install -o --overlays -e --envvar -m --mask -v --verbose +-q --quiet -C --nocolor --color -h --help -V --version' +[APPLETS]='qatom qcheck qdepends qfile qgrep qkeyword qlist qlop +qmanifest qmerge qmerge qpkg qsearch qsize qtbz2 qtegrity quse +qwhich qxpak' +[ARG]='--root' +) + +local i +for (( i=1; i < COMP_CWORD; i++ )); do +if [[ ${COMP_WORDS[i]} != -* ]]; then +if [[ " ${OPTS[APPLETS]} " =~ " ${COMP_WORDS[i]} " ]]; then +local root_command=${COMP_WORDS[i]} +_command_offset ${i} +else +COMPREPLY=() +fi +return +fi + +[[ ${i} -lt ${COMP_CWORD} && " ${OPTS[ARG]} " =~ " ${COMP_WORDS[i]} " ]] && ((i++)) +done + +case ${prev} in +--root) +_filedir -d +return +;; +esac + +if [[ ${cur} = -* ]]; then +COMPREPLY=( $(compgen -W '${OPTS[STANDALONE]} ${OPTS[ARG]}' -- "${cur}") ) +else +COMPREPLY=( $(compgen -W "${OPTS[APPLETS]}" -- "${cur}") ) +fi +} && +complete -F _q q + +# vim: ft=sh:et:ts=4:sw=4:tw=80
[gentoo-commits] proj/gentoo-bashcomp:master commit in: compat/, helpers/, completions/
commit: 6c900626704689c30dc9e7277cc1226ba4dc66b4 Author: Arthur Zamarin gentoo org> AuthorDate: Sun May 12 17:43:49 2024 + Commit: Arthur Zamarin gentoo org> CommitDate: Sun May 12 17:43:58 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=6c900626 fix copyright holder to Gentoo Authors Signed-off-by: Arthur Zamarin gentoo.org> compat/gentoo-style-init | 2 +- completions/browser-config | 2 +- completions/distcc-config | 2 +- completions/ebuild | 2 +- completions/ekeyword | 2 +- completions/emerge | 2 +- completions/epkginfo | 2 +- completions/epm| 2 +- completions/equery | 2 +- completions/euse | 2 +- completions/gcc-config | 2 +- completions/glsa-check | 2 +- completions/java-config| 2 +- completions/layman | 2 +- completions/metagen| 2 +- completions/portageq | 2 +- completions/repoman| 2 +- completions/revdep-rebuild | 2 +- completions/splat | 2 +- completions/webapp-config | 2 +- helpers/gentoo-common.sh | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/compat/gentoo-style-init b/compat/gentoo-style-init index e800c8c..82cfcce 100644 --- a/compat/gentoo-style-init +++ b/compat/gentoo-style-init @@ -2,7 +2,7 @@ # # $Id$ # -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2009 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later _gentoo_style_init() diff --git a/completions/browser-config b/completions/browser-config index 158ca42..9ca8507 100644 --- a/completions/browser-config +++ b/completions/browser-config @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later # diff --git a/completions/distcc-config b/completions/distcc-config index 41c315f..1762ecd 100644 --- a/completions/distcc-config +++ b/completions/distcc-config @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later # diff --git a/completions/ebuild b/completions/ebuild index cd6e17e..a268355 100644 --- a/completions/ebuild +++ b/completions/ebuild @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later # diff --git a/completions/ekeyword b/completions/ekeyword index 3bf3006..a182098 100644 --- a/completions/ekeyword +++ b/completions/ekeyword @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later source "@helpersdir@/gentoo-common.sh" diff --git a/completions/emerge b/completions/emerge index 98110c4..2268fca 100644 --- a/completions/emerge +++ b/completions/emerge @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later source "@helpersdir@/gentoo-common.sh" diff --git a/completions/epkginfo b/completions/epkginfo index 34c81f3..16d5871 100644 --- a/completions/epkginfo +++ b/completions/epkginfo @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later source "@helpersdir@/gentoo-common.sh" diff --git a/completions/epm b/completions/epm index e8a8caa..c41e272 100644 --- a/completions/epm +++ b/completions/epm @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later source "@helpersdir@/gentoo-common.sh" diff --git a/completions/equery b/completions/equery index a8aa829..4cee1f1 100644 --- a/completions/equery +++ b/completions/equery @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU General Public License, v2 or later source "@helpersdir@/gentoo-common.sh" diff --git a/completions/euse b/completions/euse index e7bed0a..5bc2f3c 100644 --- a/completions/euse +++ b/completions/euse @@ -1,6 +1,6 @@ # Gentoo Linux Bash Shell Command Completion # -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2013 Gentoo Authors # Distributed under the terms of the GNU Gen
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: c0a9b924a6e546c2865a375496d27ff6bea7a494 Author: Sam James gentoo org> AuthorDate: Sat May 11 03:13:25 2024 + Commit: Sam James gentoo org> CommitDate: Sat May 11 03:13:25 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c0a9b924 Makefile: bzip2 -> xz Signed-off-by: Sam James gentoo.org> Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f167c7b..5947e9e 100644 --- a/Makefile +++ b/Makefile @@ -51,10 +51,10 @@ dist: tag mkdir $(distpkg)/ git log > $(distpkg)/ChangeLog tar vfr $(distpkg).tar $(distpkg)/ChangeLog - bzip2 $(distpkg).tar + xz $(distpkg).tar rm -rf $(distpkg)/ @echo "success." dist-upload: dist - scp $(distpkg).tar.bz2 dev.gentoo.org:/space/distfiles-local/ - ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.bz2 + scp $(distpkg).tar.xz dev.gentoo.org:/space/distfiles-local/ + ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(distpkg).tar.xz
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: aa32f1e126bdf947efc012d4d6b93a7150d74b24 Author: Lucio Sauer posteo net> AuthorDate: Fri May 10 11:59:16 2024 + Commit: Sam James gentoo org> CommitDate: Sat May 11 03:11:17 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=aa32f1e1 portageq envvar: preserve PATH to avoid command validation warnings Some of Portage's environment variables undergo command validation. When one is set to a relative value, Portage relies on PATH to find the binary. We need to preserve it after purging the environment (`env -i`) if we want to avoid " is invalid: " warnings. For Portage 3.0.63, this affects PORTAGE_{B{,UN}ZIP2_COMMAND,LOG_FILTER_FILE_CMD}. Bug: https://bugs.gentoo.org/588642 Signed-off-by: Lucio Sauer posteo.net> Signed-off-by: Sam James gentoo.org> completions/portageq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/portageq b/completions/portageq index 7922e59..a8a113b 100644 --- a/completions/portageq +++ b/completions/portageq @@ -47,7 +47,7 @@ _portageq() { # this also isn't the fastest, but I welcome an alternative method envvar) -COMPREPLY=($(compgen -W "$(env -i emerge -v --info | \ +COMPREPLY=($(compgen -W "$(env -i PATH="${PATH}" emerge -v --info | \ sed -n -e '/^[[:upper:]].*=".*"/s/^\(.*\)=".*$/\1/p')" -- ${cur})) ;;
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 63aae2a1775e501678290c6dbeac53215decffc2 Author: Lucio Sauer posteo net> AuthorDate: Fri May 10 12:07:16 2024 + Commit: Sam James gentoo org> CommitDate: Sat May 11 03:11:51 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=63aae2a1 portageq envvar: fix variables selected for completion With lines like VAR="foo" BAZ="1 2 3", \(.*\)=".*$ not only matches VAR, but also VAR="foo" BAZ. This applies at line ^USE=.*, where the regular USE flags are followed by a list of all present USE_EXPAND variables together with their respective values. The current sed invocation also ignores environment variables that start with a lowercase letter, such as gl_cv_compiler_check_decl_option. Closes: https://bugs.gentoo.org/931671 Signed-off-by: Lucio Sauer posteo.net> Signed-off-by: Sam James gentoo.org> completions/portageq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/portageq b/completions/portageq index a8a113b..7775cc4 100644 --- a/completions/portageq +++ b/completions/portageq @@ -48,7 +48,7 @@ _portageq() { # this also isn't the fastest, but I welcome an alternative method envvar) COMPREPLY=($(compgen -W "$(env -i PATH="${PATH}" emerge -v --info | \ -sed -n -e '/^[[:upper:]].*=".*"/s/^\(.*\)=".*$/\1/p')" -- ${cur})) +cut -s -d = -f 1)" -- ${cur})) ;; *v@(isible|ersion)|match)
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 1e4bcaf0c6052449fda9750d4865a275a87f4336 Author: Sam James gentoo org> AuthorDate: Sun Feb 25 20:14:47 2024 + Commit: Sam James gentoo org> CommitDate: Sun Feb 25 20:14:47 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=1e4bcaf0 completions/emerge: fix indentation Signed-off-by: Sam James gentoo.org> completions/emerge | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/completions/emerge b/completions/emerge index c3be06b..98110c4 100644 --- a/completions/emerge +++ b/completions/emerge @@ -98,20 +98,20 @@ _emerge() --autounmask-backtrack --autounmask-only --autounmask-unrestricted-atoms \ --autounmask-keep-masks --autounmask-license --autounmask-use \ --accept-properties --accept-restrict --alert --alert=y --alert=n \ - --ask-enter-invalid \ - --binpkg-changed-deps --binpkg-respect-use \ - --buildpkg-exclude \ +--ask-enter-invalid \ +--binpkg-changed-deps --binpkg-respect-use \ +--buildpkg-exclude \ --buildpkg --buildpkgonly \ - --backtrack= \ +--backtrack= \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ - --complete-graph-if-new-use --complete-graph-if-new-ver \ - --config-root \ +--complete-graph-if-new-use --complete-graph-if-new-ver \ +--config-root \ --changed-deps --changed-deps-report --changed-slot --changed-use \ --debug --deep --depclean --deselect \ - --depclean-lib-check \ - --dynamic-deps --dynamic-deps=y --dynamic-deps=n \ +--depclean-lib-check \ +--dynamic-deps --dynamic-deps=y --dynamic-deps=n \ --emptytree \ - --exclude \ +--exclude \ --fetch-all-uri --fetchonly \ --getbinpkg --getbinpkgonly \ --ignore-default-opts --info \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 5a9c389ddbf6e1e1692d521f7e132110ec58d482 Author: Sam James gentoo org> AuthorDate: Wed Feb 21 07:25:23 2024 + Commit: Sam James gentoo org> CommitDate: Wed Feb 21 07:25:23 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=5a9c389d completions/emerge: add --with-test-deps Signed-off-by: Sam James gentoo.org> completions/emerge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/emerge b/completions/emerge index 915a0b0..e813817 100644 --- a/completions/emerge +++ b/completions/emerge @@ -114,7 +114,7 @@ _emerge() --tree \ --unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly \ --verbose --verbose-conflicts \ ---with-bdeps=y --with-bdeps=n" +--with-bdeps=y --with-bdeps=n --with-test-deps" if [[ ${curword} -eq 1 ]] && [[ ${numwords} -eq 2 ]] ; then opts="${opts} --help --resume --searchdesc --version" fi
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 01bd80421d77d8e538495aafffef34c23ef3cd6d Author: Sam James gentoo org> AuthorDate: Wed Feb 21 07:29:23 2024 + Commit: Sam James gentoo org> CommitDate: Wed Feb 21 07:29:23 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=01bd8042 completions/emerge: add --changed-* options * --changed-deps * --changed-deps-report * --changed-slot * --changed-use Signed-off-by: Sam James gentoo.org> completions/emerge | 1 + 1 file changed, 1 insertion(+) diff --git a/completions/emerge b/completions/emerge index e813817..442acaf 100644 --- a/completions/emerge +++ b/completions/emerge @@ -96,6 +96,7 @@ _emerge() --ask --autounmask-write --autounmask-keep-keywords --autounmask-continue \ --buildpkg --buildpkgonly \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ +--changed-deps --changed-deps-report --changed-slot --changed-use \ --debug --deep --depclean --deselect \ --emptytree \ --fetch-all-uri --fetchonly \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/
commit: c9cef9f13fe0ab333c9348f4198cf1cee81d18ec Author: Sam James gentoo org> AuthorDate: Wed Feb 21 07:27:11 2024 + Commit: Sam James gentoo org> CommitDate: Wed Feb 21 07:27:11 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c9cef9f1 helpers/gentoo-common.sh: fix whitespace Signed-off-by: Sam James gentoo.org> helpers/gentoo-common.sh | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh index 35b5946..f587be2 100644 --- a/helpers/gentoo-common.sh +++ b/helpers/gentoo-common.sh @@ -18,7 +18,7 @@ # for PORTDIR and PORTDIR_OVERLAY. While repos.conf overrides any value of # PORTDIR set in make.conf, PORTDIR_OVERLAY is incremental (combined across # available sources). -# +# # This would be a hell of a lot simpler if we used portageq, but also about # 500 times slower. _portdir() { @@ -32,7 +32,7 @@ _portdir() { source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null - + overlaypath+=(${PORTDIR_OVERLAY}) # strip out duplicates @@ -52,9 +52,9 @@ _portdir() { echo "${PORTDIR}" -if [[ ${1} == -o ]]; then +if [[ ${1} == -o ]]; then echo "${PORTDIR_OVERLAY}" -fi +fi fi } @@ -69,7 +69,7 @@ _parsereposconf() { [[ -f ${f} ]] || continue insection=0 - + while read -r line; do # skip comments and blank lines [[ -z ${line} || ${line} == '#'* ]] && continue
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 6a3d1b3d78a174db6711deb8335ab998ec6bb6c5 Author: Sam James gentoo org> AuthorDate: Wed Feb 21 07:34:19 2024 + Commit: Sam James gentoo org> CommitDate: Wed Feb 21 07:34:19 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=6a3d1b3d completions/emerge: add various further options Signed-off-by: Sam James gentoo.org> completions/emerge | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/completions/emerge b/completions/emerge index 442acaf..c3be06b 100644 --- a/completions/emerge +++ b/completions/emerge @@ -93,12 +93,25 @@ _emerge() elif [[ ${cur} == --* ]]; then # Complete on long options. opts="--alphabetical \ ---ask --autounmask-write --autounmask-keep-keywords --autounmask-continue \ +--ask \ +--autounmask-write --autounmask-keep-keywords --autounmask-continue \ +--autounmask-backtrack --autounmask-only --autounmask-unrestricted-atoms \ +--autounmask-keep-masks --autounmask-license --autounmask-use \ +--accept-properties --accept-restrict --alert --alert=y --alert=n \ + --ask-enter-invalid \ + --binpkg-changed-deps --binpkg-respect-use \ + --buildpkg-exclude \ --buildpkg --buildpkgonly \ + --backtrack= \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ + --complete-graph-if-new-use --complete-graph-if-new-ver \ + --config-root \ --changed-deps --changed-deps-report --changed-slot --changed-use \ --debug --deep --depclean --deselect \ + --depclean-lib-check \ + --dynamic-deps --dynamic-deps=y --dynamic-deps=n \ --emptytree \ + --exclude \ --fetch-all-uri --fetchonly \ --getbinpkg --getbinpkgonly \ --ignore-default-opts --info \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 1f3b30d5e4d5b39601fb403db492c2f844960975 Author: Sam James gentoo org> AuthorDate: Wed Feb 21 07:23:35 2024 + Commit: Sam James gentoo org> CommitDate: Wed Feb 21 07:23:35 2024 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=1f3b30d5 completions/emerge: add --verbose-conflicts Bug: https://bugs.gentoo.org/924830 Signed-off-by: Sam James gentoo.org> completions/emerge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/emerge b/completions/emerge index 113aa07..915a0b0 100644 --- a/completions/emerge +++ b/completions/emerge @@ -113,7 +113,7 @@ _emerge() --sync \ --tree \ --unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly \ ---verbose \ +--verbose --verbose-conflicts \ --with-bdeps=y --with-bdeps=n" if [[ ${curword} -eq 1 ]] && [[ ${numwords} -eq 2 ]] ; then opts="${opts} --help --resume --searchdesc --version"
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 8e15ae348f400c86a8314933a15d8f851f045281 Author: Sam James gentoo org> AuthorDate: Mon Mar 13 21:26:42 2023 + Commit: Sam James gentoo org> CommitDate: Mon Mar 13 21:27:22 2023 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=8e15ae34 completions/emerge: add additional options Adds the following: - --autounmask-keep-keywords - --autounmask-continue - --onlydeps-with-ideps - --onlydeps-with-rdeps - --update-if-installed Signed-off-by: Sam James gentoo.org> completions/emerge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/emerge b/completions/emerge index e84a7fc..113aa07 100644 --- a/completions/emerge +++ b/completions/emerge @@ -93,7 +93,7 @@ _emerge() elif [[ ${cur} == --* ]]; then # Complete on long options. opts="--alphabetical \ ---ask --autounmask-write \ +--ask --autounmask-write --autounmask-keep-keywords --autounmask-continue \ --buildpkg --buildpkgonly \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ --debug --deep --depclean --deselect \ @@ -105,14 +105,14 @@ _emerge() --keep-going \ --metadata \ --newuse --noconfmem --nodeps --noreplace --nospinner \ ---oneshot --onlydeps \ +--oneshot --onlydeps --onlydeps-with-ideps --onlydeps-with-rdeps \ --pretend --prune \ --quiet --rage-clean \ --reinstall=changed-use --regen \ --search \ --sync \ --tree \ ---unmerge --update --upgradeonly --usepkg --usepkgonly \ +--unmerge --update --update-if-installed --upgradeonly --usepkg --usepkgonly \ --verbose \ --with-bdeps=y --with-bdeps=n" if [[ ${curword} -eq 1 ]] && [[ ${numwords} -eq 2 ]] ; then
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/
commit: e0dab1a94fe74e2f42a32f3e658ffa877a9241d6 Author: Jernej Jakob gmail com> AuthorDate: Tue Jun 7 13:44:35 2022 + Commit: Sam James gentoo org> CommitDate: Sat Jan 14 16:39:33 2023 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=e0dab1a9 Revert "ignore non conf files in /etc/portage/repos.conf." This reverts commit f3f401b1166bb3d7f79b9f3cb8ebfc3527cd4394. The commit introduced behavior that was not consistent with portage, which parses all files in the repos.conf directory not starting with '.' or ending with '~', regardless if they end with '.conf' or not. Signed-off-by: Sam James gentoo.org> helpers/gentoo-common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh index 9424ad6..6e8d51c 100644 --- a/helpers/gentoo-common.sh +++ b/helpers/gentoo-common.sh @@ -7,7 +7,7 @@ # Retrieve PORTDIR/PORTDIR_OVERLAY location. # # In order of highest to lowest priority: -# /etc/portage/repos.conf{,/*.conf} +# /etc/portage/repos.conf{,/*} # /usr/share/portage/config/repos.conf # /etc/portage/make.conf # /etc/make.conf @@ -65,7 +65,7 @@ _parsereposconf() { for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do +@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*; do [[ -f ${f} ]] || continue insection=0
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/
commit: 184a51233d05f7b45a3c3fc73782be600add6000 Author: Jernej Jakob gmail com> AuthorDate: Tue Jun 7 13:44:35 2022 + Commit: Sam James gentoo org> CommitDate: Sat Jan 14 16:39:34 2023 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=184a5123 Ignore backup prefixed or suffixed files in repos.conf subdirectory. Portage ignores any files starting with '.' or ending with '~' in the repos.conf directory. See 'portage.util' function '_recursive_basename_filter'. Closes: https://bugs.gentoo.org/730624 Signed-off-by: Sam James gentoo.org> helpers/gentoo-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh index 6e8d51c..35b5946 100644 --- a/helpers/gentoo-common.sh +++ b/helpers/gentoo-common.sh @@ -65,7 +65,7 @@ _parsereposconf() { for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*; do +@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/[!.]*[!~]; do [[ -f ${f} ]] || continue insection=0
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: a7513c33fc3744c7664c8c6c9c3c1bb22f0b0ab9 Author: Louis Sautier gmail com> AuthorDate: Sat Nov 5 23:16:06 2022 + Commit: Sam James gentoo org> CommitDate: Sat Jan 14 16:38:46 2023 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=a7513c33 emerge: add support for --deselect Signed-off-by: Louis Sautier gmail.com> Closes: https://github.com/gentoo/gentoo-bashcomp/pull/6 Signed-off-by: Sam James gentoo.org> completions/emerge | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/emerge b/completions/emerge index 03cc503..e84a7fc 100644 --- a/completions/emerge +++ b/completions/emerge @@ -35,7 +35,7 @@ _emerge() # find action for x in ${COMP_LINE} ; do if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \ -[[ ${x} =~ --(clean|config|depclean|info|metadata|prune|rage-clean|regen|resume|search|sync|unmerge) ]] +[[ ${x} =~ --(clean|config|depclean|deselect|info|metadata|prune|rage-clean|regen|resume|search|sync|unmerge) ]] then action=${x} break @@ -96,7 +96,7 @@ _emerge() --ask --autounmask-write \ --buildpkg --buildpkgonly \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ ---debug --deep --depclean \ +--debug --deep --depclean --deselect \ --emptytree \ --fetch-all-uri --fetchonly \ --getbinpkg --getbinpkgonly \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/
commit: f3f401b1166bb3d7f79b9f3cb8ebfc3527cd4394 Author: redneb gmx com> AuthorDate: Tue Nov 16 15:42:15 2021 + Commit: Patrice Clement gentoo org> CommitDate: Tue Nov 16 16:08:23 2021 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=f3f401b1 ignore non conf files in /etc/portage/repos.conf. portage ignores any file in /etc/portage/repos.conf/ (when that is in fact a directory) that does not have a name of the form "*.conf". gentoo-bashcomp should emulate the behavior of portage. Otherwise you might run into issues: e.g. if there is a backup of eselect-repo.conf called eselect-repo.conf~ that contains references to a now removed overlay, gentoo-bashcomp should not try to search for completions in the now nonexistent repo directory Closes: https://github.com/gentoo/gentoo-bashcomp/pull/5 Signed-off-by: Patrice Clement gentoo.org> helpers/gentoo-common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh index 6e8d51c..9424ad6 100644 --- a/helpers/gentoo-common.sh +++ b/helpers/gentoo-common.sh @@ -7,7 +7,7 @@ # Retrieve PORTDIR/PORTDIR_OVERLAY location. # # In order of highest to lowest priority: -# /etc/portage/repos.conf{,/*} +# /etc/portage/repos.conf{,/*.conf} # /usr/share/portage/config/repos.conf # /etc/portage/make.conf # /etc/make.conf @@ -65,7 +65,7 @@ _parsereposconf() { for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*; do +@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do [[ -f ${f} ]] || continue insection=0
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/
commit: 7052f3bab2abeb620733fff21b2809429bacc554 Author: Patrice Clement gentoo org> AuthorDate: Sun Feb 10 23:02:43 2019 + Commit: Patrice Clement gentoo org> CommitDate: Sun Feb 10 23:04:09 2019 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=7052f3ba fix repos.conf files pattern matching. Courtesy of Duncan <1i5t5.duncan cox.net>. Closes: https://bugs.gentoo.org/562626 Signed-off-by: Patrice Clement gentoo.org> helpers/gentoo-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/gentoo-common.sh b/helpers/gentoo-common.sh index c0be688..6e8d51c 100644 --- a/helpers/gentoo-common.sh +++ b/helpers/gentoo-common.sh @@ -65,7 +65,7 @@ _parsereposconf() { for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ @GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do +@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*; do [[ -f ${f} ]] || continue insection=0
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 48adce4356f46eda30265d2c5a6cb4055c16c5e3 Author: Louis Sautier gmail com> AuthorDate: Sun Jun 10 16:26:46 2018 + Commit: Patrice Clement gentoo org> CommitDate: Sat Jun 23 22:23:00 2018 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=48adce43 emerge: add support for sets completion. Based on Marco Genasci's patch and slightly modified to get rid of the unnecessary call to xargs. Courtesy of Marco Genasci gmail.com>. Closes: https://bugs.gentoo.org/235454 Closes: https://github.com/gentoo/gentoo-bashcomp/pull/4 completions/emerge | 6 ++ 1 file changed, 6 insertions(+) diff --git a/completions/emerge b/completions/emerge index d7da227..03cc503 100644 --- a/completions/emerge +++ b/completions/emerge @@ -26,6 +26,12 @@ _emerge() return 0 fi +if [[ ${cur} =~ ^@ ]] ; then +local SET_LIST=($(emerge --list-sets)) +COMPREPLY=($(compgen -W '${SET_LIST[@]/#/@}' ${cur})) +return 0 +fi + # find action for x in ${COMP_LINE} ; do if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 41d0608e51e5fe3b5034de9ae3700c2490380e2e Author: William Hubbs gentoo org> AuthorDate: Fri Mar 2 18:33:51 2018 + Commit: William Hubbs gentoo org> CommitDate: Fri Mar 2 18:35:09 2018 + 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..000 --- 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..000 --- 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 ) -# 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 ^$
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: a5c0c7a1c5610f8040ea1fdb1d0a1f8c4d2f45b3 Author: Louis Sautier gmail com> AuthorDate: Mon Feb 15 00:15:46 2016 + Commit: Michał Górny gentoo org> CommitDate: Fri Mar 2 18:06:51 2018 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=a5c0c7a1 add completion for emerge --rage-clean This PR adds the --rage-clean option. Closes: https://github.com/gentoo/gentoo-bashcomp/pull/2 completions/emerge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/emerge b/completions/emerge index a7d1f52..d7da227 100644 --- a/completions/emerge +++ b/completions/emerge @@ -29,7 +29,7 @@ _emerge() # find action for x in ${COMP_LINE} ; do if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \ -[[ ${x} =~ --(clean|config|depclean|info|metadata|prune|regen|resume|search|sync|unmerge) ]] +[[ ${x} =~ --(clean|config|depclean|info|metadata|prune|rage-clean|regen|resume|search|sync|unmerge) ]] then action=${x} break @@ -101,7 +101,7 @@ _emerge() --newuse --noconfmem --nodeps --noreplace --nospinner \ --oneshot --onlydeps \ --pretend --prune \ ---quiet \ +--quiet --rage-clean \ --reinstall=changed-use --regen \ --search \ --sync \ @@ -153,7 +153,7 @@ _emerge() fi # Complete on installed packages when unmerging. -if [[ "${action}" == '--unmerge' ]]; then +if [[ "${action}" =~ --(rage-clean|unmerge) ]]; then if [[ -n "${cur}" ]] ; then if [[ "${cur}" == */* ]]; then words=$(builtin cd @GENTOO_PORTAGE_EPREFIX@/var/db/pkg; compgen -G "${cur}*")
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 5c9fbe55124aef398e9e23186a1ef83e592a09d4 Author: Louis Sautier gmail com> AuthorDate: Thu Jan 7 10:35:56 2016 + Commit: Michał Górny gentoo org> CommitDate: Fri Mar 2 18:06:45 2018 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=5c9fbe55 Add completion for emerge --autounmask-write Closes: https://github.com/gentoo/gentoo-bashcomp/pull/1 completions/emerge | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/emerge b/completions/emerge index 63c02b4..a7d1f52 100644 --- a/completions/emerge +++ b/completions/emerge @@ -86,7 +86,8 @@ _emerge() fi elif [[ ${cur} == --* ]]; then # Complete on long options. -opts="--alphabetical --ask \ +opts="--alphabetical \ +--ask --autounmask-write \ --buildpkg --buildpkgonly \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ --debug --deep --depclean \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: compat/, completions/, /
commit: 1d1cb2687fc7d60411eb9c91404f1714349a202e Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:53:13 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 18:54:12 2014 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=1d1cb268 Move completions into subdirectories. completions/ for files going to completionsdir, compat/ for those going into compatdir. gentoo-style-init => compat/gentoo-style-init | 0 gentoo => completions/gentoo | 0 layman => completions/layman | 0 repoman => completions/repoman| 0 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/gentoo-style-init b/compat/gentoo-style-init similarity index 100% rename from gentoo-style-init rename to compat/gentoo-style-init diff --git a/gentoo b/completions/gentoo similarity index 100% rename from gentoo rename to completions/gentoo diff --git a/layman b/completions/layman similarity index 100% rename from layman rename to completions/layman diff --git a/repoman b/completions/repoman similarity index 100% rename from repoman rename to completions/repoman
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: 83db19445f037ff9385f80ae7f9ed787bfc55262 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:42:59 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 18:42:59 2014 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=83db1944 Makefile: remove the outdated install target temporarily. It is just wrong, so there is no point in keeping it for now. I will write new rules after refactoring the code. Makefile | 9 - 1 file changed, 9 deletions(-) diff --git a/Makefile b/Makefile index e8f87cd..da4702b 100644 --- a/Makefile +++ b/Makefile @@ -5,18 +5,9 @@ distapp = gentoo-bashcomp distver := $(shell date -u +%Y%m%d) distpkg := $(distapp)-$(distver) -PREFIX = /usr - all: @echo Nothing to compile. -install: - install -d "$(DESTDIR)$(PREFIX)/share/bash-completion" - install -m0644 gentoo "$(DESTDIR)$(PREFIX)/share/bash-completion" - install -d "$(DESTDIR)/etc/bash_completion.d" - ln -snf "../..$(PREFIX)/share/bash-completion/gentoo" \ - "$(DESTDIR)/etc/bash_completion.d/gentoo" - tag: git pull git tag -a $(distpkg) -m "tag $(distpkg)"
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: ce8ecda4ece83c04d481acacbed97a61e989cb64 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 20:30:03 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 21:18:58 2014 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=ce8ecda4 Makefile: introduce a new 'install' rule. That handles proper install paths and substitutions. Makefile | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Makefile b/Makefile index da4702b..f167c7b 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,40 @@ distapp = gentoo-bashcomp distver := $(shell date -u +%Y%m%d) distpkg := $(distapp)-$(distver) +DESTDIR = +EPREFIX = + +# prefer paths from pkg-config, fallback to sane defaults +completionsdir ?= $(or \ + $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null), \ + ${EPREFIX}/usr/share/bash-completion/completions) +helpersdir ?= $(or \ + $(shell pkg-config --variable=helpersdir bash-completion 2>/dev/null), \ + ${EPREFIX}/usr/share/bash-completion/helpers) +compatdir ?= $(or \ + $(shell pkg-config --variable=compatdir bash-completion 2>/dev/null), \ + ${EPREFIX}/etc/bash_completion.d) + +completions := $(wildcard completions/*) +helpers := $(wildcard helpers/*) +compats := $(wildcard compat/*) + +POSTINST_SED = sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" -e "s|@helpersdir@|$(helpersdir)|" + all: @echo Nothing to compile. +install: + install -d "$(DESTDIR)$(completionsdir)" + install -m0644 $(completions) "$(DESTDIR)$(completionsdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(completionsdir)"/,$(notdir $(completions))) + install -d "$(DESTDIR)$(helpersdir)" + install -m0644 $(helpers) "$(DESTDIR)$(helpersdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(helpersdir)"/,$(notdir $(helpers))) + install -d "$(DESTDIR)$(compatdir)" + install -m0644 $(compats) "$(DESTDIR)$(compatdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(compatdir)"/,$(notdir $(compats))) + tag: git pull git tag -a $(distpkg) -m "tag $(distpkg)"
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/, completions/
commit: 238b95dfeb8f32f592756797786a998b0f07c748 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:49:57 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 19:18:12 2014 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=238b95df Split common functions out of completions. The goal is to install the reusable functions in helpersdir from where they can be reused by other completions. completions/gentoo | 390 +- helpers/gentoo-common.sh | 395 +++ 2 files changed, 396 insertions(+), 389 deletions(-) diff --git a/completions/gentoo b/completions/gentoo index 0e54841..30a1eb1 100644 --- a/completions/gentoo +++ b/completions/gentoo @@ -3,377 +3,7 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# Retrieve PORTDIR/PORTDIR_OVERLAY location. -# -# In order of highest to lowest priority: -# /etc/portage/repos.conf{,/*} -# /usr/share/portage/config/repos.conf -# /etc/portage/make.conf -# /etc/make.conf -# /usr/share/portage/config/make.globals -# -# The first two files are in repos.conf format and must be parsed for the -# variable "location". The rest are make.conf style and are simply sourced -# for PORTDIR and PORTDIR_OVERLAY. While repos.conf overrides any value of -# PORTDIR set in make.conf, PORTDIR_OVERLAY is incremental (combined across -# available sources). -# -# This would be a hell of a lot simpler if we used portageq, but also about -# 500 times slower. -_portdir() { -local mainreponame mainrepopath overlayname overlaypath - -if [[ -e @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf ]]; then -if [[ ${1} == -o ]]; then -for overlayname in $(_parsereposconf -l); do -overlaypath+=($(_parsereposconf ${overlayname} location)) -done - -source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null - -overlaypath+=(${PORTDIR_OVERLAY}) - -# strip out duplicates -overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u)) - -echo "${overlaypath[@]}" -else -mainreponame=$(_parsereposconf DEFAULT main-repo) -mainrepopath=$(_parsereposconf ${mainreponame} location) - -echo "${mainrepopath}" -fi -else -source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null - -echo "${PORTDIR}" - -if [[ ${1} == -o ]]; then -echo "${PORTDIR_OVERLAY}" -fi -fi -} - -# _parsereposconf [-l] -# -l lists available repos -_parsereposconf() { -local f insection line section v value var - -for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do - -[[ -f ${f} ]] || continue -insection=0 - -while read -r line; do -# skip comments and blank lines -[[ -z ${line} || ${line} == '#'* ]] && continue - -if [[ ${insection} == 1 && ${line} == '['*']' ]]; then -# End of the section we were interested in so stop -secname+=(${line//[(\[|\])]/}) # record name for -l -break -elif [[ ${line} == '['*']' ]]; then -# Entering a new section, check if it's the one we want -section=${line//[(\[|\])]/} -[[ ${section} == "${1}" ]] && insection=1 -secname+=(${section}) # record name for -l -elif [[ ${insection} == 1 ]]; then -# We're in the section we want, grab the values -var=${line%%=*} -var=${var// /} -value=${line#*=} -value=${value# } -[[ ${var} == ${2} ]] && v=${value} -fi -continue -done < "${f}" -done - -if [[ ${1} == -l ]]; then -echo "${secname[@]}" -else -echo "${v}" -fi -} - -# like _pkgname but completes on package names only (no category) -_pkgname_only() -{ -local i pd -local cur="$1" -shift -local dir="$@" - -COMPREPLY=($(compgen -W "$(\ -for pd in $dir ; do \ -builtin cd ${pd}; \ -for i in *-*/${cur}*; do \ -[[ -d ${i} ]] && { local x=${i##*/} ; echo ${x%-[0-9]*}; } \ -done ; \ -done)" -- ${cur})) -} - -# -# This function completes package names. -# -# usage: pkgname -# -# Where mode is one of: -# -A Search all available
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 1781d5b81021858db447d4c63f68e081e320fd00 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 19:18:57 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 19:18:57 2014 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=1781d5b8 Split completions by completed command. completions/browser-config | 31 + completions/distcc-config | 41 ++ completions/ebuild | 34 + completions/ekeyword | 46 ++ completions/emerge | 410 +++ completions/epkginfo | 28 + completions/epm| 48 ++ completions/equery | 280 completions/euse | 60 ++ completions/gcc-config | 45 ++ completions/gentoo | 1652 completions/glsa-check | 33 + completions/java-config| 158 + completions/metagen| 30 + completions/portageq | 87 +++ completions/rc | 21 + completions/rc-service | 111 +++ completions/rc-status | 28 + completions/rc-update | 40 ++ completions/revdep-rebuild | 55 ++ completions/splat | 33 + completions/webapp-config | 169 + 22 files changed, 1788 insertions(+), 1652 deletions(-) diff --git a/completions/browser-config b/completions/browser-config new file mode 100644 index 000..158ca42 --- /dev/null +++ b/completions/browser-config @@ -0,0 +1,31 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# browser-config completion command +# +_browserconfig() +{ +local cur prev +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" +prev="${COMP_WORDS[COMP_CWORD-1]}" +if [[ ${COMP_CWORD} -eq 1 ]]; then +COMPREPLY=($(compgen -W '-b -h -m' -- ${cur})) +elif [[ "${prev}" == "-b" ]]; then +COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/usr/share/browser-config/*; do [ -f $i ] && echo ${i##*/}; done)" $cur)) +elif [[ "${prev}" == "-m" ]]; then +COMPREPLY=($(compgen -W "same_window new_window new_tab new_browser" -- ${cur})) +if [[ -z "${COMPREPLY}" ]]; then +COMPREPLY='' +fi +else +unset COMPREPLY +fi +return 0 +} && +complete -F _browserconfig browser-config + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/distcc-config b/completions/distcc-config new file mode 100644 index 000..41c315f --- /dev/null +++ b/completions/distcc-config @@ -0,0 +1,41 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# distcc-config completion command +# +_distccconfig() +{ +local cur curword numwords opts +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" +numwords=${#COMP_WORDS[*]} +curword=${COMP_CWORD} +if [[ ${numwords} -gt 3 ]]; then +unset COMPREPLY +return 0 +fi +if [[ "${cur}" == -* ]] || [ ${curword} -eq 1 ]; then +if [[ ${numwords} -le 2 ]] && [[ ${curword} -eq 1 ]]; then +opts="--get-hosts \ +--get-verbose \ +--get-log \ +--set-hosts \ +--set-verbose \ +--set-log \ +--add-path \ +--no-path" +else +opts="" +fi +else +opts="" +fi +COMPREPLY=($(compgen -W "${opts}" | grep ^$cur)) +return 0 +} && +complete -F _distccconfig distcc-config + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/ebuild b/completions/ebuild new file mode 100644 index 000..cd6e17e --- /dev/null +++ b/completions/ebuild @@ -0,0 +1,34 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# ebuild completion command +# +_ebuild() +{ +local cur opts +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" + +opts="help setup clean fetch digest manifest unpack compile test preinst \ +install postinst qmerge merge unmerge prerm postrm config package rpm \ +configure prepare" + +if [[ $COMP_CWORD -eq 1 ]] ; then +COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) \ +$(compgen -d -- ${cur}) \ +$(compgen -W '--debug --force --help --ignore-default-opts --skip-manifest' -- ${cur})) + +elif [[ $COMP_CWORD -eq 2 && "${COMP_WORDS[1]}" = "--debug --force --ignore-default-opts --skip-manifest" ]] ; then +COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur})) + +elif [[ $COMP_CWORD -ge 2 ]] ; then +COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +fi +return 0 +} && +complete -o filenames -F _ebuild ebuild + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/ekeyword b/completions/ekeyword new file mode 100644 index 000..3bf3006 --- /dev/null +++ b/comp
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: c35f6a954e9bc6098edbfc4be686867272862f6c Author: Louis Sautier gmail com> AuthorDate: Mon Feb 15 00:15:46 2016 + Commit: Patrice Clement gentoo org> CommitDate: Wed Mar 16 11:41:55 2016 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c35f6a95 add completion for emerge --rage-clean This PR adds the --rage-clean option. Closes: https://github.com/gentoo/gentoo-bashcomp/pull/2 gentoo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gentoo b/gentoo index 8935a40..deee23f 100644 --- a/gentoo +++ b/gentoo @@ -399,7 +399,7 @@ _emerge() # find action for x in ${COMP_LINE} ; do if [[ ${x} =~ ^(system|world)$ ]] || [[ ${x} =~ -[CPcs] ]] || \ -[[ ${x} =~ --(clean|config|depclean|info|metadata|prune|regen|resume|search|sync|unmerge) ]] +[[ ${x} =~ --(clean|config|depclean|info|metadata|prune|rage-clean|regen|resume|search|sync|unmerge) ]] then action=${x} break @@ -471,7 +471,7 @@ _emerge() --newuse --noconfmem --nodeps --noreplace --nospinner \ --oneshot --onlydeps \ --pretend --prune \ ---quiet \ +--quiet --rage-clean \ --reinstall=changed-use --regen \ --search \ --sync \ @@ -523,7 +523,7 @@ _emerge() fi # Complete on installed packages when unmerging. -if [[ "${action}" == '--unmerge' ]]; then +if [[ "${action}" =~ --(rage-clean|unmerge) ]]; then if [[ -n "${cur}" ]] ; then if [[ "${cur}" == */* ]]; then words=$(builtin cd @GENTOO_PORTAGE_EPREFIX@/var/db/pkg; compgen -G "${cur}*")
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: c53f2c946634eb3cd440cef570729866277734de Author: Louis Sautier gmail com> AuthorDate: Thu Jan 7 10:35:56 2016 + Commit: Patrice Clement gentoo org> CommitDate: Thu Jan 7 10:35:56 2016 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=c53f2c94 Add completion for emerge --autounmask-write gentoo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gentoo b/gentoo index 0e54841..8935a40 100644 --- a/gentoo +++ b/gentoo @@ -456,7 +456,8 @@ _emerge() fi elif [[ ${cur} == --* ]]; then # Complete on long options. -opts="--alphabetical --ask \ +opts="--alphabetical \ +--ask --autounmask-write \ --buildpkg --buildpkgonly \ --changelog --clean --color=y --color=n --columns --complete-graph --config \ --debug --deep --depclean \
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: eac314dc58d45a336e5808296cacc580cb17bc7f Author: Patrice Clement gentoo org> AuthorDate: Thu Jan 14 13:14:29 2016 + Commit: Patrice Clement gentoo org> CommitDate: Thu Jan 14 13:16:37 2016 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=eac314dc Merge remote-tracking branch 'github/pr/1'. Courtesy of Louis Sautier gmail.com>. Signed-off-by: Patrice Clement gentoo.org> gentoo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: 9f3ef4ef2b43043c66f97d5fb07b65da0c33c794 Author: Patrice Clement gentoo org> AuthorDate: Sat Oct 10 20:16:37 2015 + Commit: Patrice Clement gentoo org> CommitDate: Sat Oct 10 20:16:37 2015 + URL: https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=9f3ef4ef Add a whitespace. TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index 1f7630e..2c8155c 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,4 @@ Todo List for gentoo-bashcomp Todo list is motivated by bugs filed at http://bugs.gentoo.org +
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: ce8ecda4ece83c04d481acacbed97a61e989cb64 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 20:30:03 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 21:18:58 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=ce8ecda4 Makefile: introduce a new 'install' rule. That handles proper install paths and substitutions. --- Makefile | 31 +++ 1 file changed, 31 insertions(+) diff --git a/Makefile b/Makefile index da4702b..f167c7b 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,40 @@ distapp = gentoo-bashcomp distver := $(shell date -u +%Y%m%d) distpkg := $(distapp)-$(distver) +DESTDIR = +EPREFIX = + +# prefer paths from pkg-config, fallback to sane defaults +completionsdir ?= $(or \ + $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null), \ + ${EPREFIX}/usr/share/bash-completion/completions) +helpersdir ?= $(or \ + $(shell pkg-config --variable=helpersdir bash-completion 2>/dev/null), \ + ${EPREFIX}/usr/share/bash-completion/helpers) +compatdir ?= $(or \ + $(shell pkg-config --variable=compatdir bash-completion 2>/dev/null), \ + ${EPREFIX}/etc/bash_completion.d) + +completions := $(wildcard completions/*) +helpers := $(wildcard helpers/*) +compats := $(wildcard compat/*) + +POSTINST_SED = sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" -e "s|@helpersdir@|$(helpersdir)|" + all: @echo Nothing to compile. +install: + install -d "$(DESTDIR)$(completionsdir)" + install -m0644 $(completions) "$(DESTDIR)$(completionsdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(completionsdir)"/,$(notdir $(completions))) + install -d "$(DESTDIR)$(helpersdir)" + install -m0644 $(helpers) "$(DESTDIR)$(helpersdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(helpersdir)"/,$(notdir $(helpers))) + install -d "$(DESTDIR)$(compatdir)" + install -m0644 $(compats) "$(DESTDIR)$(compatdir)" + $(POSTINST_SED) $(addprefix "$(DESTDIR)$(compatdir)"/,$(notdir $(compats))) + tag: git pull git tag -a $(distpkg) -m "tag $(distpkg)"
[gentoo-commits] proj/gentoo-bashcomp:master commit in: helpers/, completions/
commit: 238b95dfeb8f32f592756797786a998b0f07c748 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:49:57 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 19:18:12 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=238b95df Split common functions out of completions. The goal is to install the reusable functions in helpersdir from where they can be reused by other completions. --- completions/gentoo | 390 +- helpers/gentoo-common.sh | 395 +++ 2 files changed, 396 insertions(+), 389 deletions(-) diff --git a/completions/gentoo b/completions/gentoo index 0e54841..30a1eb1 100644 --- a/completions/gentoo +++ b/completions/gentoo @@ -3,377 +3,7 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# Retrieve PORTDIR/PORTDIR_OVERLAY location. -# -# In order of highest to lowest priority: -# /etc/portage/repos.conf{,/*} -# /usr/share/portage/config/repos.conf -# /etc/portage/make.conf -# /etc/make.conf -# /usr/share/portage/config/make.globals -# -# The first two files are in repos.conf format and must be parsed for the -# variable "location". The rest are make.conf style and are simply sourced -# for PORTDIR and PORTDIR_OVERLAY. While repos.conf overrides any value of -# PORTDIR set in make.conf, PORTDIR_OVERLAY is incremental (combined across -# available sources). -# -# This would be a hell of a lot simpler if we used portageq, but also about -# 500 times slower. -_portdir() { -local mainreponame mainrepopath overlayname overlaypath - -if [[ -e @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf ]]; then -if [[ ${1} == -o ]]; then -for overlayname in $(_parsereposconf -l); do -overlaypath+=($(_parsereposconf ${overlayname} location)) -done - -source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null - -overlaypath+=(${PORTDIR_OVERLAY}) - -# strip out duplicates -overlaypath=($(printf "%s\n" "${overlaypath[@]}" | sort -u)) - -echo "${overlaypath[@]}" -else -mainreponame=$(_parsereposconf DEFAULT main-repo) -mainrepopath=$(_parsereposconf ${mainreponame} location) - -echo "${mainrepopath}" -fi -else -source @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/make.conf 2>/dev/null -source @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf 2>/dev/null - -echo "${PORTDIR}" - -if [[ ${1} == -o ]]; then -echo "${PORTDIR_OVERLAY}" -fi -fi -} - -# _parsereposconf [-l] -# -l lists available repos -_parsereposconf() { -local f insection line section v value var - -for f in @GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf \ -@GENTOO_PORTAGE_EPREFIX@/etc/portage/repos.conf/*.conf; do - -[[ -f ${f} ]] || continue -insection=0 - -while read -r line; do -# skip comments and blank lines -[[ -z ${line} || ${line} == '#'* ]] && continue - -if [[ ${insection} == 1 && ${line} == '['*']' ]]; then -# End of the section we were interested in so stop -secname+=(${line//[(\[|\])]/}) # record name for -l -break -elif [[ ${line} == '['*']' ]]; then -# Entering a new section, check if it's the one we want -section=${line//[(\[|\])]/} -[[ ${section} == "${1}" ]] && insection=1 -secname+=(${section}) # record name for -l -elif [[ ${insection} == 1 ]]; then -# We're in the section we want, grab the values -var=${line%%=*} -var=${var// /} -value=${line#*=} -value=${value# } -[[ ${var} == ${2} ]] && v=${value} -fi -continue -done < "${f}" -done - -if [[ ${1} == -l ]]; then -echo "${secname[@]}" -else -echo "${v}" -fi -} - -# like _pkgname but completes on package names only (no category) -_pkgname_only() -{ -local i pd -local cur="$1" -shift -local dir="$@" - -COMPREPLY=($(compgen -W "$(\ -for pd in $dir ; do \ -builtin cd ${pd}; \ -for i in *-*/${cur}*; do \ -[[ -d ${i} ]] && { local x=${i##*/} ; echo ${x%-[0-9]*}; } \ -done ; \ -done)" -- ${cur})) -} - -# -# This function completes package names. -# -# usage: pkgname -# -# Where mode is one of: -# -A Search
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /, compat/, completions/
commit: 1d1cb2687fc7d60411eb9c91404f1714349a202e Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:53:13 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 18:54:12 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=1d1cb268 Move completions into subdirectories. completions/ for files going to completionsdir, compat/ for those going into compatdir. --- gentoo-style-init => compat/gentoo-style-init | 0 gentoo => completions/gentoo | 0 layman => completions/layman | 0 repoman => completions/repoman| 0 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/gentoo-style-init b/compat/gentoo-style-init similarity index 100% rename from gentoo-style-init rename to compat/gentoo-style-init diff --git a/gentoo b/completions/gentoo similarity index 100% rename from gentoo rename to completions/gentoo diff --git a/layman b/completions/layman similarity index 100% rename from layman rename to completions/layman diff --git a/repoman b/completions/repoman similarity index 100% rename from repoman rename to completions/repoman
[gentoo-commits] proj/gentoo-bashcomp:master commit in: /
commit: 83db19445f037ff9385f80ae7f9ed787bfc55262 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 18:42:59 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 18:42:59 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=83db1944 Makefile: remove the outdated install target temporarily. It is just wrong, so there is no point in keeping it for now. I will write new rules after refactoring the code. --- Makefile | 9 - 1 file changed, 9 deletions(-) diff --git a/Makefile b/Makefile index e8f87cd..da4702b 100644 --- a/Makefile +++ b/Makefile @@ -5,18 +5,9 @@ distapp = gentoo-bashcomp distver := $(shell date -u +%Y%m%d) distpkg := $(distapp)-$(distver) -PREFIX = /usr - all: @echo Nothing to compile. -install: - install -d "$(DESTDIR)$(PREFIX)/share/bash-completion" - install -m0644 gentoo "$(DESTDIR)$(PREFIX)/share/bash-completion" - install -d "$(DESTDIR)/etc/bash_completion.d" - ln -snf "../..$(PREFIX)/share/bash-completion/gentoo" \ - "$(DESTDIR)/etc/bash_completion.d/gentoo" - tag: git pull git tag -a $(distpkg) -m "tag $(distpkg)"
[gentoo-commits] proj/gentoo-bashcomp:master commit in: completions/
commit: 1781d5b81021858db447d4c63f68e081e320fd00 Author: Michał Górny gentoo org> AuthorDate: Sun Aug 31 19:18:57 2014 + Commit: Michał Górny gentoo org> CommitDate: Sun Aug 31 19:18:57 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-bashcomp.git;a=commit;h=1781d5b8 Split completions by completed command. --- completions/browser-config | 31 + completions/distcc-config | 41 ++ completions/ebuild | 34 + completions/ekeyword | 46 ++ completions/emerge | 410 +++ completions/epkginfo | 28 + completions/epm| 48 ++ completions/equery | 280 completions/euse | 60 ++ completions/gcc-config | 45 ++ completions/gentoo | 1652 completions/glsa-check | 33 + completions/java-config| 158 + completions/metagen| 30 + completions/portageq | 87 +++ completions/rc | 21 + completions/rc-service | 111 +++ completions/rc-status | 28 + completions/rc-update | 40 ++ completions/revdep-rebuild | 55 ++ completions/splat | 33 + completions/webapp-config | 169 + 22 files changed, 1788 insertions(+), 1652 deletions(-) diff --git a/completions/browser-config b/completions/browser-config new file mode 100644 index 000..158ca42 --- /dev/null +++ b/completions/browser-config @@ -0,0 +1,31 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# browser-config completion command +# +_browserconfig() +{ +local cur prev +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" +prev="${COMP_WORDS[COMP_CWORD-1]}" +if [[ ${COMP_CWORD} -eq 1 ]]; then +COMPREPLY=($(compgen -W '-b -h -m' -- ${cur})) +elif [[ "${prev}" == "-b" ]]; then +COMPREPLY=($(compgen -W "$(for i in @GENTOO_PORTAGE_EPREFIX@/usr/share/browser-config/*; do [ -f $i ] && echo ${i##*/}; done)" $cur)) +elif [[ "${prev}" == "-m" ]]; then +COMPREPLY=($(compgen -W "same_window new_window new_tab new_browser" -- ${cur})) +if [[ -z "${COMPREPLY}" ]]; then +COMPREPLY='' +fi +else +unset COMPREPLY +fi +return 0 +} && +complete -F _browserconfig browser-config + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/distcc-config b/completions/distcc-config new file mode 100644 index 000..41c315f --- /dev/null +++ b/completions/distcc-config @@ -0,0 +1,41 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# distcc-config completion command +# +_distccconfig() +{ +local cur curword numwords opts +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" +numwords=${#COMP_WORDS[*]} +curword=${COMP_CWORD} +if [[ ${numwords} -gt 3 ]]; then +unset COMPREPLY +return 0 +fi +if [[ "${cur}" == -* ]] || [ ${curword} -eq 1 ]; then +if [[ ${numwords} -le 2 ]] && [[ ${curword} -eq 1 ]]; then +opts="--get-hosts \ +--get-verbose \ +--get-log \ +--set-hosts \ +--set-verbose \ +--set-log \ +--add-path \ +--no-path" +else +opts="" +fi +else +opts="" +fi +COMPREPLY=($(compgen -W "${opts}" | grep ^$cur)) +return 0 +} && +complete -F _distccconfig distcc-config + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/ebuild b/completions/ebuild new file mode 100644 index 000..cd6e17e --- /dev/null +++ b/completions/ebuild @@ -0,0 +1,34 @@ +# Gentoo Linux Bash Shell Command Completion +# +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +# +# ebuild completion command +# +_ebuild() +{ +local cur opts +COMPREPLY=() +cur="${COMP_WORDS[COMP_CWORD]}" + +opts="help setup clean fetch digest manifest unpack compile test preinst \ +install postinst qmerge merge unmerge prerm postrm config package rpm \ +configure prepare" + +if [[ $COMP_CWORD -eq 1 ]] ; then +COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) \ +$(compgen -d -- ${cur}) \ +$(compgen -W '--debug --force --help --ignore-default-opts --skip-manifest' -- ${cur})) + +elif [[ $COMP_CWORD -eq 2 && "${COMP_WORDS[1]}" = "--debug --force --ignore-default-opts --skip-manifest" ]] ; then +COMPREPLY=($(compgen -f -X "!*.ebuild" -- ${cur}) $(compgen -d -- ${cur})) + +elif [[ $COMP_CWORD -ge 2 ]] ; then +COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +fi +return 0 +} && +complete -o filenames -F _ebuild ebuild + +# vim: ft=sh:et:ts=4:sw=4:tw=80 diff --git a/completions/ekeyword b/completions/ekeyword new file mode 100644 index 000..3bf3006 --- /dev/n