Commit 0c6d5c27 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add print our commands to bash completion, to print usage

parent ca4de805
......@@ -5,13 +5,14 @@
#
_service_list()
{
COMPREPLY=( $( serv list-all 2>/dev/null ) )
COMPREPLY=( $( serv list-all 2>/dev/null ; echo "list list-all list-startup" ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
_service_usage_list()
{
COMPREPLY=( $( compgen -W '`serv ${prev##*/} 2>/dev/null | sed -e "y/|/ /" -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" `' -- "$cur" ) )
local USLIST=$(serv ${prev##*/} usage 2>/dev/null | sed -e "y/|/ /" -ne "s/^.*\(u\|U\|msg_u\)sage.*{\(.*\)}.*$/\2/p")
COMPREPLY=( $( compgen -W '$USLIST' -- "$cur" ) )
}
......
......@@ -17,6 +17,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
_print_additional_usage()
{
echo "serv addition usage: {on|off|try-restart|usage}"
}
# Print usage of the service
serv_usage()
{
......@@ -40,4 +45,6 @@ serv_usage()
;;
esac
_print_additional_usage
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment