3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# systemd-detect-virt(1) completion -*- shell-script -*-
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# This file is part of systemd.
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# Copyright 2014 Thomas H.P. Andersen
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# systemd is free software; you can redistribute it and/or modify it
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# under the terms of the GNU Lesser General Public License as published by
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# the Free Software Foundation; either version 2.1 of the License, or
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# (at your option) any later version.
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# systemd is distributed in the hope that it will be useful, but
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# WITHOUT ANY WARRANTY; without even the implied warranty of
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# General Public License for more details.
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# You should have received a copy of the GNU Lesser General Public License
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen# along with systemd; If not, see <http://www.gnu.org/licenses/>.
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen__contains_word() {
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen local w word=$1; shift
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen for w in "$@"; do
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen [[ $w = "$word" ]] && return
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen_systemd_detect_virt() {
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen local i verb comps
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen [STANDALONE]='-h --help --version -c --container -v --vm -q --quiet'
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen _init_completion || return
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersen COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
3bfe58cbd4a9b1d2520f425f95de718f3a583d39Thomas Hindoe Paaboel Andersencomplete -F _systemd_detect_virt systemd-detect-virt