diff --git a/etc/shell/bash/bash_completion_custom b/etc/shell/bash/bash_completion_custom index aba230b..9445a57 100755 --- a/etc/shell/bash/bash_completion_custom +++ b/etc/shell/bash/bash_completion_custom @@ -1,6 +1,6 @@ #!/bin/bash ######################### # -# Изменён: Ср 05 фев 2020 14:38:27 +# Изменён: Чт 27 фев 2020 00:31:10 # #complete <что дополнять> <программа> @@ -102,5 +102,15 @@ _git-commit() { fi } +_services () { + if [[ $2 == "" ]]; then + COMPREPLY=($(\ls /etc/init.d/ | sed '/^\/.*:$/d; /^\s*$/d' 2> /dev/null)) + else + COMPREPLY=($(\ls /etc/init.d/ | sed '/^\/.*:$/d; /^\s*$/d' | grep "^$2" 2> /dev/null)) + fi +} + +complete -F _services start stop restart + #complete -c _git-commit git g