chiark / gitweb /
bash-completion: avoid appending space after field competion
[elogind.git] / bash-completion / systemd-bash-completion.sh
index a03433269cb28a8f779a4948b01f685335eac070..82c25a3894f57f2d9e444031319e4b81cd611e55 100644 (file)
@@ -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