diff options
author | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-01-25 15:46:01 -0800 |
---|---|---|
committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-01-25 15:46:01 -0800 |
commit | 364ef418b4b71336cec52869718056a1b6ce2273 (patch) | |
tree | 8f38519826b14d37433ea544b0514ba35d58041a /tools | |
parent | 7b6f0be8004bad874f642efaabee72dd60ad92c4 (diff) | |
download | python-novaclient-364ef418b4b71336cec52869718056a1b6ce2273.tar.gz |
Fix bash completion on osx
The osx version of sed does not support \s so replace uses of it
with [ ] and clean up the regex a bit.
Change-Id: Ic6fd2e4234352ddb8ec70d42b44ad00a3906db0e
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nova.bash_completion | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/nova.bash_completion b/tools/nova.bash_completion index 7dee3e6d..fefa7983 100644 --- a/tools/nova.bash_completion +++ b/tools/nova.bash_completion @@ -9,10 +9,10 @@ _nova() prev="${COMP_WORDS[COMP_CWORD-1]}" if [ "x$_nova_opts" == "x" ] ; then - nbc="`nova bash-completion | sed -e "s/\s-h\s/ /"`" - _nova_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" - _nova_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/\s\s*/ /g"`" - _nova_opts_exp="`echo "$_nova_opts" | sed -e "s/\s/|/g"`" + nbc="`nova bash-completion | sed -e "s/[ ]+/ /"`" + _nova_opts="`echo "$nbc" | sed -e "s/--[a-z0-9_-]*//g" -e "s/[ ]+/ /g"`" + _nova_flags="`echo " $nbc" | sed -e "s/ [^-][^-][a-z0-9_-]*//g" -e "s/[ ]+/ /g"`" + _nova_opts_exp="`echo "$_nova_opts" | sed -e "s/[ ]/|/g"`" fi if [[ " ${COMP_WORDS[@]} " =~ " "($_nova_opts_exp)" " && "$prev" != "help" ]] ; then |