1
0
Fork 0
tuned/tuned-adm.bash
Jaroslav Škarvada 15dc0865f0 Fixed bash completion
Resolves: rhbz#1207668

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-04-01 18:13:10 +02:00

19 lines
504 B
Bash

# bash completion for tuned-adm
_tuned_adm()
{
local commands="active list off profile recommend"
local cur prev words cword
_init_completion || return
if [[ "$cword" -eq 1 ]]; then
COMPREPLY=( $(compgen -W "$commands" -- "$cur" ) )
elif [[ "$cword" -eq 2 && "$prev" == "profile" ]]; then
COMPREPLY=( $(compgen -W "$(command find /usr/lib/tuned /etc/tuned -mindepth 1 -maxdepth 1 -type d -printf "%f\n")" -- "$cur" ) )
else
COMPREPLY=()
fi
return 0
} &&
complete -F _tuned_adm tuned-adm