diff --git a/CHANGES b/CHANGES index 48de2681..7d01a29c 100644 --- a/CHANGES +++ b/CHANGES @@ -27,7 +27,7 @@ bash-completion (2.x) mysqladmin, screen, service, scp, ssh, update-alternatives, and general hostname completions. * Add abook and wtf completion, based on work by Raphaƫl Droz. - * Add jarsigner, k3b, lftpget, pack200 and unpack200 completions. + * Add jarsigner, k3b, lftpget, pm-utils, pack200 and unpack200 completions. * Don't overwrite other host completions when completing from multiple SSH known hosts files. * Speed up installed rpm package completion on SUSE, based on work by diff --git a/Makefile.am b/Makefile.am index 50ffc53d..9f2cb5bc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,6 +95,7 @@ bashcomp_DATA = contrib/abook \ contrib/pkg-config \ contrib/pkg_install \ contrib/pkgtools \ + contrib/pm-utils \ contrib/portupgrade \ contrib/postfix \ contrib/postgresql \ diff --git a/contrib/pm-utils b/contrib/pm-utils new file mode 100644 index 00000000..85d4f21c --- /dev/null +++ b/contrib/pm-utils @@ -0,0 +1,34 @@ +# bash completion for pm-utils + +have pm-is-supported && +_pm_is_supported() +{ + local cur=`_get_cword` + COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \ + -- "$cur" ) ) +} && +complete -F _pm_is_supported pm-is-supported + +have pm-hibernate || have pm-suspend || have pm-suspend-hybrid && +_pm_action() +{ + local cur=`_get_cword` + COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) ) +} && +complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid + +have pm-powersave && +_pm_powersave() +{ + local cur=`_get_cword` + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) +} && +complete -F _pm_powersave pm-powersave + +# 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