1 # bash-completion add-on for rpmlint
2 # http://bash-completion.alioth.debian.org/
4 _rpmlint_installed_packages()
6 if declare -F _rpm_installed_packages &>/dev/null ; then
7 _rpm_installed_packages
8 elif declare -F _xfunc &>/dev/null ; then
9 # bash-completion 1.90+ dynamic loading
10 _xfunc rpm _rpm_installed_packages
17 local cur=$2 # for _rpm_installed_packages, _filedir
20 -C|--checkdir|-E|--extractdir)
29 # should take --checkdir, python path, inheritance into account...
30 COMPREPLY=( $( compgen -W \
31 "$( command ls /usr/share/rpmlint/*Check.py* 2>/dev/null |
32 sed -e '/^AbstractCheck/d' \
33 -e 's|.*/\([^/.]*\)\.py.*|\1|' )" -- "$cur" ) )
37 # should take --checkdir into account...
38 COMPREPLY=( $( compgen -W "$( sed -e '1,/^addDetails/d' \
39 -ne "s/^'\([^'[:space:]]\{1,\}\)',\$/\1/p" \
40 /usr/share/rpmlint/*Check.py 2>/dev/null )" -- "$cur" ) ) #'
44 # argument required but no completions available
49 if [[ "$cur" == -* ]]; then
50 COMPREPLY=( $( compgen -W '--info --explain --check --all --checkdir
51 --help --verbose --extractdir --version --noexception
52 --file --option' -- "$cur" ) )
54 # Installed packages completion is potentially slow, do it only if $cur
55 # does not look like a path.
56 [[ $cur != */* && $cur != [.~]* ]] && _rpmlint_installed_packages
57 _filedir @([rs]pm|spec)
60 complete -F _rpmlint -o filenames rpmlint
65 local cur=$2 # for _rpm_installed_packages, _filedir
69 COMPREPLY=( $( compgen -W 'S M 5 D N L V U G F T' -- "$cur" ) )
77 if [[ "$cur" == -* ]]; then
78 COMPREPLY=( $( compgen -W '--help --ignore' -- "$cur" ) )
80 # Installed packages completion is potentially slow, do it only if $cur
81 # does not look like a path.
82 [[ $cur != */* && $cur != [.~]* ]] && _rpmlint_installed_packages
86 complete -F _rpmdiff -o filenames rpmdiff
91 # sh-indent-comment: t
92 # indent-tabs-mode: nil
94 # ex: ts=4 sw=4 et filetype=sh