dotfiles/.zsh/functions/_journal

13 lines
432 B
Plaintext
Raw Normal View History

2020-01-25 19:41:15 +01:00
#compdef journal
__systemctl () {
systemctl $_sys_service_mgr --full --no-legend --no-pager "$@" 2> /dev/null
}
(( $+functions[_journal_units] )) || _systemctl_get_non_template_names () {
echo -E - ${^${(R)${(f)"$(
__systemctl $mode list-unit-files "$PREFIX*"
__systemctl $mode list-units --all "$PREFIX*"
)"}:#*@.*}%%[[:space:]]*}
}
_wanted systemd-units expl unit compadd "$@" - $(_systemctl_get_non_template_names)