summaryrefslogtreecommitdiff
path: root/layman
diff options
context:
space:
mode:
authorRyan Hill <dirtyepic@gentoo.org>2012-10-21 17:03:48 -0600
committerRyan Hill <dirtyepic@gentoo.org>2012-10-21 18:55:01 -0600
commit6a9662fd54d22f36062279886686e84b79928f2d (patch)
tree4c93c09e4dfbecaac866eaac75f9064aa4e28a01 /layman
parentRewrite repoman completion. (diff)
downloadgentoo-bashcomp-6a9662fd54d22f36062279886686e84b79928f2d.tar.gz
gentoo-bashcomp-6a9662fd54d22f36062279886686e84b79928f2d.tar.bz2
gentoo-bashcomp-6a9662fd54d22f36062279886686e84b79928f2d.zip
Add modelines and retab.
Diffstat (limited to 'layman')
-rw-r--r--layman115
1 files changed, 57 insertions, 58 deletions
diff --git a/layman b/layman
index c3457db..0463f9a 100644
--- a/layman
+++ b/layman
@@ -2,7 +2,7 @@
#
# $Id$
#
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
#
# Originally licensed as 'public-domain'
@@ -10,66 +10,65 @@
have layman && {
- _layman()
- {
- local cur prev opts r_overlays l_overlays
- opts="-a --add -d --delete -s --sync -i --info -S --sync-all -L --list \
- -l --list-local -f --fetch -n --nofetch -p --priority -c --config \
- -o --overlays -v --verbose -q --quiet -N --nocolor -Q --quietness \
- -k --nocheck --debug --debug-level --debug-verbose --debug-methods \
- --debug-classes --debug-variables --debug-class-vars --debug-nocolor"
+ _layman()
+ {
+ local cur prev opts r_overlays l_overlays
+ opts="-a --add -d --delete -s --sync -i --info -S --sync-all -L --list \
+ -l --list-local -f --fetch -n --nofetch -p --priority -c --config \
+ -o --overlays -v --verbose -q --quiet -N --nocolor -Q --quietness \
+ -k --nocheck --debug --debug-level --debug-verbose --debug-methods \
+ --debug-classes --debug-variables --debug-class-vars --debug-nocolor"
- r_overlays="$(layman -LkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- l_overlays="$(layman -lkN 2>/dev/null | grep '(source' | awk '{print $2}')"
- ls_overlays="${l_overlays} ALL"
+ r_overlays="$(layman -LkN 2>/dev/null | grep '(source' | awk '{print $2}')"
+ l_overlays="$(layman -lkN 2>/dev/null | grep '(source' | awk '{print $2}')"
+ ls_overlays="${l_overlays} ALL"
- COMPREPLY=()
+ COMPREPLY=()
- cur="${COMP_WORDS[COMP_CWORD]}"
- prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]
- then
- COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
- return 0
- fi
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]]
+ then
+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+ return 0
+ fi
- case "${prev}" in
- -a|--add)
- COMPREPLY=($(compgen -W "${r_overlays}" -- ${cur}))
- return 0
- ;;
- -d|--delete)
- COMPREPLY=($(compgen -W "${l_overlays}" -- "${cur}"))
- return 0
- ;;
- -s|--sync)
- COMPREPLY=($(compgen -W "${ls_overlays}" -- "${cur}"))
- return 0
- ;;
- -i|--info)
- COMPREPLY=($(compgen -W "${r_overlays}" -- "${cur}"))
- return 0
- ;;
- -p|--priority)
- COMPREPLY=($(compgen -W "$(seq 0 100)" -- "${cur}"))
- return 0
- ;;
- -Q|--quietness)
- COMPREPLY=($(compgen -W "$(seq 0 4)" -- "${cur}"))
- return 0
- ;;
- --debug-level)
- COMPREPLY=($(compgen -W "$(seq 0 10)" -- "${cur}"))
- return 0
- ;;
- --debug-verbose)
- COMPREPLY=($(compgen -W "$(seq 1 3)" -- "${cur}"))
- return 0
- ;;
- esac
- }
- complete -F _layman layman
+ case "${prev}" in
+ -a|--add)
+ COMPREPLY=($(compgen -W "${r_overlays}" -- ${cur}))
+ return 0
+ ;;
+ -d|--delete)
+ COMPREPLY=($(compgen -W "${l_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -s|--sync)
+ COMPREPLY=($(compgen -W "${ls_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -i|--info)
+ COMPREPLY=($(compgen -W "${r_overlays}" -- "${cur}"))
+ return 0
+ ;;
+ -p|--priority)
+ COMPREPLY=($(compgen -W "$(seq 0 100)" -- "${cur}"))
+ return 0
+ ;;
+ -Q|--quietness)
+ COMPREPLY=($(compgen -W "$(seq 0 4)" -- "${cur}"))
+ return 0
+ ;;
+ --debug-level)
+ COMPREPLY=($(compgen -W "$(seq 0 10)" -- "${cur}"))
+ return 0
+ ;;
+ --debug-verbose)
+ COMPREPLY=($(compgen -W "$(seq 1 3)" -- "${cur}"))
+ return 0
+ ;;
+ esac
+ }
+ complete -F _layman layman
}
-
-# vim: set ft=sh tw=80 sw=4 et :
+# vim: ft=sh:et:ts=4:sw=4:tw=80