Blame | Last modification | View Log | RSS feed
# bash completion for tuned and tuned-adm_tuned(){local options="-d --daemon -c --config -D --debug"local current="${COMP_WORDS[$COMP_CWORD]}"local previous="${COMP_WORDS[$COMP_CWORD-1]}"if [[ "$previous" == "-c" || "$previous" == "--config" ]]; thenCOMPREPLY=( $(compgen -f -- "$current") )elseCOMPREPLY=( $(compgen -W "$options" -- "$current") )fireturn 0} &&complete -F _tuned -o filenames tuned_tuned_adm(){local commands="help list active off profile"local current="${COMP_WORDS[$COMP_CWORD]}"local previous="${COMP_WORDS[$COMP_CWORD-1]}"if [[ $COMP_CWORD -eq 1 ]]; thenCOMPREPLY=( $(compgen -W "$commands" -- "$current" ) )elif [[ $COMP_CWORD -eq 2 && "$previous" == "profile" ]]; thenCOMPREPLY=( $(compgen -W "$(command ls -F /etc/tune-profiles | \sed '/\/$/!d;s/.$//')" -- "$current" ) )elseCOMPREPLY=()fireturn 0} &&complete -F _tuned_adm tuned-adm# Local variables:# mode: shell-script# sh-basic-offset: 4# sh-indent-comment: t# indent-tabs-mode: nil# End:# ex: ts=4 sw=4 et filetype=sh