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