mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-02 09:47:03 +03:00
parent
dd74faef7a
commit
aea447c9f8
@ -62,6 +62,8 @@ __filter_units_by_properties () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
|
__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
|
||||||
|
| { while read -r a b; do echo " $a"; done; }; }
|
||||||
|
__get_non_template_units() { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
|
||||||
| { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
|
| { while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }; }
|
||||||
__get_template_names () { __systemctl $1 list-unit-files \
|
__get_template_names () { __systemctl $1 list-unit-files \
|
||||||
| { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
|
| { while read -r a b; do [[ $a =~ @\. ]] && echo " ${a%%@.*}@"; done; }; }
|
||||||
@ -172,7 +174,8 @@ _systemctl () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local -A VERBS=(
|
local -A VERBS=(
|
||||||
[ALL_UNITS]='is-active is-failed is-enabled status show cat mask preset help list-dependencies edit set-property revert'
|
[ALL_UNITS]='cat mask'
|
||||||
|
[NONTEMPLATE_UNITS]='is-active is-failed is-enabled status show preset help list-dependencies edit set-property revert'
|
||||||
[ENABLED_UNITS]='disable'
|
[ENABLED_UNITS]='disable'
|
||||||
[DISABLED_UNITS]='enable'
|
[DISABLED_UNITS]='enable'
|
||||||
[REENABLABLE_UNITS]='reenable'
|
[REENABLABLE_UNITS]='reenable'
|
||||||
@ -212,6 +215,10 @@ _systemctl () {
|
|||||||
comps=$( __get_all_units $mode )
|
comps=$( __get_all_units $mode )
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
|
||||||
|
elif __contains_word "$verb" ${VERBS[NONTEMPLATE_UNITS]}; then
|
||||||
|
comps=$( __get_non_template_units $mode )
|
||||||
|
compopt -o filenames
|
||||||
|
|
||||||
elif __contains_word "$verb" ${VERBS[ENABLED_UNITS]}; then
|
elif __contains_word "$verb" ${VERBS[ENABLED_UNITS]}; then
|
||||||
comps=$( __get_enabled_units $mode )
|
comps=$( __get_enabled_units $mode )
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
Loading…
x
Reference in New Issue
Block a user