bash-completion: use default completion for redirect operators
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 23 Mar 2019 20:49:17 +0000 (21:49 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 23 Mar 2019 20:50:50 +0000 (21:50 +0100)
shell-completion/bash/journalctl

index f2e882c..cdb1fc7 100644 (file)
@@ -52,6 +52,13 @@ _journalctl() {
                               --vacuum-size --vacuum-time --vacuum-files --output-fields'
         )
 
+        # Use the default completion for shell redirect operators
+        if __contains_word "$prev" '>' '>>' '&>'; then
+                compopt -o filenames
+                COMPREPLY=( $(compgen -f -- "$cur") )
+                return 0;
+        fi
+
         if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then
                 case $prev in
                         --boot|-b)