2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
5 # Copyright 2013 Red Hat, Inc. All rights reserved.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 for w in $*; do [[ $w = $word ]] && return 0; done
28 local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
30 [STANDALONE]='-s --size -h --help'
32 [ARG]='-f --file -k --kver'
35 if __contains_word "$prev" ${OPTS[ARG]}; then
38 comps=$(compgen -f -- "$cur")
42 comps=$(cd /lib/modules; echo [0-9]*)
48 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
52 if [[ $cur = -* ]]; then
53 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
57 comps=$(compgen -f -- "$cur")
59 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
63 complete -F _lsinitrd lsinitrd