Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 383496 Details for
Bug 476992
app-admin/eselect-bashcomp: Provide a way to make specific completions hidden from the bash-completion autoloader when using upstream bash-completion scheme
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Initial attempt at new bashcomp module
bashcomp.eselect (text/plain), 3.04 KB, created by
Michał Górny
on 2014-08-24 08:54:17 UTC
(
hide
)
Description:
Initial attempt at new bashcomp module
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2014-08-24 08:54:17 UTC
Size:
3.04 KB
patch
obsolete
># -*-eselect-*- vim: ft=eselect ># Copyright 2005-2013 Gentoo Foundation ># Distributed under the terms of the GNU GPL version 2 or later > >DESCRIPTION="Manage contributed bash-completion scripts" >MAINTAINER="eselect@gentoo.org" > >COMPLETIONS_DIR=${EROOT%/}/usr/share/bash-completion/completions >COMPLETIONS_BLACKLIST=${EROOT%}/etc/bash/completion.blacklist > >find_targets() { > local bc > > # Note: safe to cd, we're in a subshell > cd "${COMPLETIONS_DIR}" || die > for bc in *; do > [[ -f ${bc} && ${bc} != *~ ]] && echo "${bc}" > done | sort -u >} > >is_enabled() { > ! grep -q -s "^${1}$" "${COMPLETIONS_BLACKLIST}" >} > >post_update() { > # adjust permissions if necessary > chmod a+r "${COMPLETIONS_BLACKLIST}" || die > > echo "For the changes to apply to open shells, you may need to run:" > echo " complete -r ${*}" > echo "in each of them." >} > >### list action ### > >describe_list() { > echo "List available completions" >} > >do_list() { > local targets i > targets=( $(find_targets) ) > > for (( i = 0; i < ${#targets[@]}; i++ )); do > is_enabled ${opts} "${targets[i]}" \ > && targets[i]=$(highlight_marker "${targets[i]}") > done > > write_list_start "Available completions:" > write_numbered_list -m "(none found)" "${targets[@]}" >} > >### enable action ### > >describe_enable() { > echo "Enable specified completion(s)" >} > >describe_enable_parameters() { > echo "<target>" >} > >describe_enable_options() { > echo "<target> : Target name or number (from 'list' action)" >} > >do_enable() { > [[ $# -eq 0 ]] && die -q "You didn't specify any completions to enable." > > local bc target targets=( $(find_targets) ) changed=() > > for bc; do > target=${bc} > is_number "${target}" && target=${targets[target-1]} > > [[ -z ${target} || ${target} == */* ]] \ > && die -q "Target \"${bc}\" doesn't appear to be valid!" > > bc=${target} > > # not on blacklist? > if is_enabled "${bc}"; then > # does it exist? > if ! has "${bc}" "${targets[@]}"; then > write_error_msg "${bc} doesn't exist" > continue > fi > > write_warning_msg "${bc} is not disabled" > continue > fi > > # enable it > sed -i -e "/^${bc}$/d" "${COMPLETIONS_BLACKLIST}" || die > changed+=( "${bc}" ) > done > > post_update "${changed[@]}" >} > >### disable action ### > >describe_disable() { > echo "Disable specified completion(s)" >} > >describe_disable_parameters() { > echo "<target>" >} > >describe_disable_options() { > echo "<target> : Target name or number (from 'list' action)" >} > > >do_disable() { > [[ $# -eq 0 ]] && die -q "You didn't specify any completions to enable." > > local bc target targets=( $(find_targets) ) changes=() > > for bc; do > target=${bc} > is_number "${target}" && target=${targets[target-1]} > > [[ -z ${target} || ${target} == */* ]] \ > && die -q "Target \"${bc}\" doesn't appear to be valid!" > > bc=${target} > > # already disabled? > if ! is_enabled "${bc}"; then > write_warning_msg "${bc} is not enabled" > continue > fi > > # does it exist? > if ! has "${bc}" "${targets[@]}"; then > write_error_msg "${bc} doesn't exist" > continue > fi > > # disable it > echo "${bc}" >> "${COMPLETIONS_BLACKLIST}" || die > > changes+=( "${bc}" ) > done > > post_update "${changes[@]}" >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 476992
:
383496
|
383498
|
383506
|
383508