]> git.ipfire.org Git - thirdparty/systemd.git/commit
Support Bash completions for short option group in journalctl (#40214)
authorGuiorgy <Guiorgy123@gmail.com>
Wed, 31 Dec 2025 14:58:58 +0000 (18:58 +0400)
committerGitHub <noreply@github.com>
Wed, 31 Dec 2025 14:58:58 +0000 (14:58 +0000)
commitf5530c10b87c465db44dc1d562872bd31fa5f212
tree61e917be001a2a81a52cb52f230d4b0ac9904f6e
parent506b790d71aff5cd8612c3dd256872341db94ab9
Support Bash completions for short option group in journalctl (#40214)

Currently, the Bash completions for journalctl tries to match the
previous word _**exactly**_, which leads to the following issue:
`journalctl -u dock` correctly auto completes to `journalctl -u
docker.service`, but `journalctl -eu` provides no completions at all,
which is a shame since I never use the `-u` option alone (almost always
`-eu` or `-efu`, I wish the `-e` option was the default but I digress).

The proposed solution is to assume words that start with only a single
dash and consist of only letters are short option groups and handle them
as if the previous word was the short option using the last character,
e.g. `-efu` -> `-u`.
shell-completion/bash/journalctl