diff options
author | Paul Stauffer <paulds@horde.com> | 2015-08-17 21:00:11 -0700 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-09-08 07:49:30 -0700 |
commit | 0bd9beabd2facbd2c7fb52e74dc56ecb89abde8e (patch) | |
tree | c6bac507aa88664670aab184f25f1c53f94f3d40 /extras/command-completion/gluster.bash | |
parent | 96af474045c9ba5ab74ca76daa823d91a0a0c610 (diff) |
bash-completion: Swap order of characters in egrep bracket expression
With glusterfs-cli installed, bash tab completion fails to work and prints an
error message:
$ gluster volgrep: Invalid range end
^C
The problem is caused by the ordering of characters within an egrep bracket
expression in the "_gluster_completion()" function defined in
/etc/bash_completion.d/gluster. The file contains this line:
egrep -ao --color=never "([A-Za-z0-9_-.]+)|[[:space:]]+|." | \
And egrep is interpreting the "-" character in that bracket expression as
indicating a range is being requested, "_-." Fortunately, "_" actually comes
after ".", this range expression is invalid, and egrep throws the error instead
of silently not doing what was intended.
The fix is simply to swap the positions of "-" and "." in that bracket
expression:
egrep -ao --color=never "([A-Za-z0-9_.-]+)|[[:space:]]+|." | \
With this change, bash tab completion works as intended.
Change-Id: Iace2d57a1122b4530987ba6f5f5558b56b094665
BUG: 1243108
Signed-off-by: Paul Stauffer <paulds@horde.com>
Reviewed-on: http://review.gluster.org/11939
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'extras/command-completion/gluster.bash')
-rw-r--r-- | extras/command-completion/gluster.bash | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/command-completion/gluster.bash b/extras/command-completion/gluster.bash index be0591c7211..680ecd964d5 100644 --- a/extras/command-completion/gluster.bash +++ b/extras/command-completion/gluster.bash @@ -480,7 +480,7 @@ _gluster_handle_list () _gluster_completion () { FINAL_LIST=`echo $GLUSTER_COMMAND_TREE | \ - egrep -ao --color=never "([A-Za-z0-9_-.]+)|[[:space:]]+|." | \ + egrep -ao --color=never "([A-Za-z0-9_.-]+)|[[:space:]]+|." | \ egrep -v --color=never "^[[:space:]]*$" | \ _gluster_parse` |