diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2025-01-02 03:48:58 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2025-01-02 03:48:58 +0100 |
commit | 0578c26bd68fa729d0d198b6e9f864b3b317e419 (patch) | |
tree | 5f7e36cb3c7b9472be97ee5c9411238a3f11dadf | |
parent | 60-sensor.hwdb: Loosen model mask to include entire series (diff) | |
download | systemd-0578c26bd68fa729d0d198b6e9f864b3b317e419.tar.xz systemd-0578c26bd68fa729d0d198b6e9f864b3b317e419.zip |
bash-completion/journalctl: list user units when --user is already specified
Follow-up for 52051dd84c45c745ca877d8893be6f71aa27bf97.
Fixes #35794.
-rw-r--r-- | shell-completion/bash/journalctl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/shell-completion/bash/journalctl b/shell-completion/bash/journalctl index 5d1cc174c9..e70d799905 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 |