diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index 5d1cc174c92..e70d7999055 100644 --- a/shell-completion/bash/journalctl +++ b/shell-completion/bash/journalctl @@ -94,7 +94,11 @@ _journalctl() { compopt -o nosort ;; --unit|-u) - comps=$(journalctl -F '_SYSTEMD_UNIT' 2>/dev/null) + if __contains_word "--user" ${COMP_WORDS[*]}; then + comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null) + else + comps=$(journalctl -F '_SYSTEMD_UNIT' 2>/dev/null) + fi # Similarly to systemctl, we need to distinguish between # escaped and unescaped names in order to be able to correctly # complete them. In this particular case, if the name we're