[systemd-commits] bash-completion/systemd-bash-completion.sh

Dave Reisner dreisner at kemper.freedesktop.org
Sat Oct 20 15:38:34 PDT 2012


 bash-completion/systemd-bash-completion.sh |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 0dd17959075e9ffe1e851c75fcc6a162d225feea
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Sat Oct 20 18:36:06 2012 -0400

    bash-completion: avoid appending space after field competion
    
    Resolves the TODO, and also uses compgen's -S flag to append the
    trailing equals, rather than relying on an array-wide parameter
    expansion.
    
    Suggested-by: Ran Benita <ran234 at gmail.com>

diff --git a/bash-completion/systemd-bash-completion.sh b/bash-completion/systemd-bash-completion.sh
index a034332..82c25a3 100644
--- a/bash-completion/systemd-bash-completion.sh
+++ b/bash-completion/systemd-bash-completion.sh
@@ -331,11 +331,8 @@ _journalctl() {
                 mapfile -t field_vals < <(journalctl -F "${COMP_WORDS[COMP_CWORD-2]}" 2>/dev/null)
                 COMPREPLY=( $(compgen -W '${field_vals[*]}' -- "$cur") )
         else
-                # append an '=' to the end of the completed field
-                # TODO: would be nice to be able to tell readline here not to
-                # append an extra space after the completed word, if such an
-                # option exists.
-                COMPREPLY=( $(compgen -W '${journal_fields[*]/%/=}' -- "$cur") )
+                compopt -o nospace
+                COMPREPLY=( $(compgen -W '${journal_fields[*]}' -S= -- "$cur") )
         fi
 }
 complete -F _journalctl journalctl



More information about the systemd-commits mailing list