summaryrefslogtreecommitdiff
path: root/completions/lintian
diff options
context:
space:
mode:
Diffstat (limited to 'completions/lintian')
-rw-r--r--completions/lintian73
1 files changed, 34 insertions, 39 deletions
diff --git a/completions/lintian b/completions/lintian
index e2237893..65121151 100644
--- a/completions/lintian
+++ b/completions/lintian
@@ -1,10 +1,7 @@
-# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
-# ex: ts=8 sw=8 noet filetype=sh
-#
-# bash completion for lintian(1) and lintian-info(1)
+# bash completion for lintian(1) and lintian-info(1) -*- shell-script -*-
-have lintian && {
-_lintian_tags() {
+_lintian_tags()
+{
local match search tags
tags=$( grep -e ^Tag /usr/share/lintian/checks/*.desc | cut -d\ -f2 )
@@ -15,17 +12,17 @@ _lintian_tags() {
| cut -d: -f1 )
tags=$( echo $tags | sed -e "s/\<$item\>//g" )
done
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags") )
+ COMPREPLY+=( $(compgen -W "$tags") )
elif [[ "$cur" == *,* ]]; then
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$tags" -- \
- "${cur##*,}") )
+ COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$tags" -- "${cur##*,}") )
else
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags" -- "$cur") )
+ COMPREPLY+=( $(compgen -W "$tags" -- "$cur") )
fi
return 0
}
-_lintian_checks() {
+_lintian_checks()
+{
local match search todisable checks
checks=$(grep -e ^Check-Script -e ^Abbrev \
@@ -41,17 +38,17 @@ _lintian_checks() {
checks=$( echo $checks | sed -e "s/\<$name\>//g" )
done
done
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks") )
+ COMPREPLY+=( $(compgen -W "$checks") )
elif [[ "$cur" == *,* ]]; then
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$checks" \
- -- "${cur##*,}") )
+ COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$checks" -- "${cur##*,}") )
else
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks" -- "$cur") )
+ COMPREPLY+=( $(compgen -W "$checks" -- "$cur") )
fi
return 0
}
-_lintian_infos() {
+_lintian_infos()
+{
local match search infos
infos=$(grep -e ^Collector /usr/share/lintian/collection/*.desc \
@@ -63,32 +60,34 @@ _lintian_infos() {
/usr/share/lintian/collection/*.desc | cut -d: -f1 )
infos=$( echo $infos | sed -e "s/\<$item\>//g" )
done
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos") )
+ COMPREPLY+=( $(compgen -W "$infos") )
elif [[ "$cur" == *,* ]]; then
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$infos" \
- -- "${cur##*,}") )
+ COMPREPLY+=( $(compgen -P "${cur%,*}," -W "$infos" -- "${cur##*,}") )
else
- COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos" -- "$cur") )
+ COMPREPLY+=( $(compgen -W "$infos" -- "$cur") )
fi
return 0
}
-_lintian_arches() {
+_lintian_arches()
+{
return 0
}
-_lintian() {
- local cur prev action lint_actions general_opts behaviour_opts \
- configuration_opts selection_opts
+_lintian()
+{
+ local cur prev words cword
+ _init_completion || return
- _get_comp_words_by_ref cur prev
+ local action lint_actions general_opts behaviour_opts \
+ configuration_opts selection_opts
lint_actions="--setup-lab --remove-lab --check --check-part --tags \
--tags-from-file --ftp-master-rejects --dont-check-part \
--unpack --remove"
general_opts="--help --version --print-version --verbose --debug --quiet"
behaviour_opts="--info --display-info --display-experimental --pedantic \
- --display-level --suppress-tags --unpack-level \
+ --display-level --suppress-tags \
--suppress-tags-from-file --no-override --show-overrides \
--color --unpack-info --md5sums --checksums --allow-root \
--fail-on-warnings --keep-lab"
@@ -111,10 +110,6 @@ _lintian() {
--lab|--archivedir|--dist|--root)
_filedir -d
;;
- -l|--unpack-level)
- COMPREPLY=($(compgen -W "0 none 1 basic 2 contents" -- \
- "$cur"))
- ;;
--color)
COMPREPLY=($(compgen -W "never always auto html" -- "$cur"))
;;
@@ -156,12 +151,13 @@ _lintian() {
;;
esac
return 0
-}
-
-_lintian_info() {
- local cur prev
+} &&
+complete -F _lintian lintian
- _get_comp_words_by_ref cur prev
+_lintian_info()
+{
+ local cur prev words cword
+ _init_completion || return
case "$prev" in
-t|--tags)
@@ -179,8 +175,7 @@ _lintian_info() {
;;
esac
return 0
-}
-
-complete -F _lintian lintian
+} &&
complete -F _lintian_info lintian-info
-}
+
+# ex: ts=4 sw=4 et filetype=sh