dotfiles/.zsh/functions/_journal

13 lines
432 B
Plaintext

#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)