1
0
Fork 0

Added bash-completion for tuned-adm

This commit is contained in:
Jaroslav Škarvada 2012-03-29 00:48:58 +02:00
parent d6ff00ee0c
commit abde247cb8
3 changed files with 26 additions and 0 deletions

View file

@ -52,6 +52,10 @@ install:
mkdir -p $(DESTDIR)$(TUNED_PROFILESDIR)
cp -a profiles/* $(DESTDIR)$(TUNED_PROFILESDIR)/
# Install bash completion
mkdir -p $(DESTDIR)/etc/bash_completion.d
install -m 0644 tuned.bash $(DESTDIR)/etc/bash_completion.d/tuned.bash
# log dir
mkdir -p $(DESTDIR)/var/log/tuned

20
tuned.bash Normal file
View file

@ -0,0 +1,20 @@
# bash completion for tuned-adm
_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 ]]; then
COMPREPLY=( $(compgen -W "$commands" -- "$current" ) )
elif [[ $COMP_CWORD -eq 2 && "$previous" == "profile" ]]; then
COMPREPLY=( $(compgen -W "$(command ls -F /usr/lib/tuned | \
sed '/\/$/!d;s/.$//')" -- "$current" ) )
else
COMPREPLY=()
fi
return 0
} &&
complete -F _tuned_adm tuned-adm

View file

@ -88,6 +88,7 @@ fi
%doc COPYING
%doc README
%doc doc/TIPS.txt
%{_sysconfdir}/bash_completion.d
%{python_sitelib}/tuned
%{_sbindir}/tuned
%{_sbindir}/tuned-adm
@ -137,6 +138,7 @@ fi
- Reduced number of installed profiles, others added into profiles-compat subpackage
- Added tuned_powertop_profile.py into utils subpackage
- Added tuned, tuned-adm man pages
- Added bash-completion
* Mon Mar 22 2012 Jan Kaluza <jkaluza@redhat.com> 2.0-0.2.alpha
- Added tuned-adm and tuned.cfg man page