summaryrefslogtreecommitdiff
path: root/tools/neutron.bash_completion
diff options
context:
space:
mode:
authorMing Yang <me@ongmingyang.com>2015-05-29 11:21:54 -0700
committerMing Yang <me@ongmingyang.com>2015-06-12 13:32:44 -0700
commitc809e068a042fd876fa5b5bf7074b8c28ede3967 (patch)
tree56f6a775973e1c1bc92c1d0071d78f7ea7e02f63 /tools/neutron.bash_completion
parent71f56399cc9b714d05bb9cde3dc9e33be0c83acd (diff)
downloadpython-neutronclient-c809e068a042fd876fa5b5bf7074b8c28ede3967.tar.gz
Allow bash completion script to work with BSD sed
Shorthand \s isn't POSIX compliant; it works with GNU sed, but not BSD sed. Changed \s to the literal whitespace character to fix this issue. Change-Id: I936b372e4022a4717a64cea9a8928b6dc00c6711 Closes-Bug: #1459470 Closes-Bug: #1277492
Diffstat (limited to 'tools/neutron.bash_completion')
-rw-r--r--tools/neutron.bash_completion6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/neutron.bash_completion b/tools/neutron.bash_completion
index 3e542e0..aa8e4e4 100644
--- a/tools/neutron.bash_completion
+++ b/tools/neutron.bash_completion
@@ -10,9 +10,9 @@ _neutron()
if [ "x$_neutron_opts" == "x" ] ; then
nbc="`neutron bash-completion`"
- _neutron_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/\s\s*/ /g"`"
- _neutron_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/\s\s*/ /g"`"
- _neutron_opts_exp="`echo "$_neutron_opts" | sed -e "s/\s/|/g"`"
+ _neutron_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/[ ][ ]*/ /g"`"
+ _neutron_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/[ ][ ]*/ /g"`"
+ _neutron_opts_exp="`echo "$_neutron_opts" | sed -e "s/[ ]/|/g"`"
fi
if [[ " ${COMP_WORDS[@]} " =~ " "($_neutron_opts_exp)" " && "$prev" != "help" ]] ; then