]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bash-completion/journalctl: also escape the current input of user unit 35799/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jan 2025 02:50:38 +0000 (11:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jan 2025 02:50:44 +0000 (11:50 +0900)
Follow-up for cec82cb943d0fd23dd09309be62c6bcde6b47839.

shell-completion/bash/journalctl

index e70d7999055b5b0777465ff4e4a849dcf6028f3f..e7b8d57902d8ac914597699974e5cebaa8f3b0ba 100644 (file)
@@ -113,6 +113,10 @@ _journalctl() {
                 ;;
             --user-unit)
                 comps=$(journalctl -F '_SYSTEMD_USER_UNIT' 2>/dev/null)
+                if ! [[ $cur =~ '\\' ]]; then
+                    cur="$(printf '%q' $cur)"
+                fi
+                compopt -o filenames
                 ;;
             --identifier|-t|--exclude-identifier|-T)
                 comps=$(journalctl -F 'SYSLOG_IDENTIFIER' 2>/dev/null)