Fix condition syntax and add special case of '~/' path.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Oct 2012 21:25:08 +0300
changeset 577 50e17493c476
parent 576 3d5ba8711141
child 578 c4ed974c79ce
Fix condition syntax and add special case of '~/' path.
.bash_completion
--- a/.bash_completion	Mon Oct 22 21:00:36 2012 +0300
+++ b/.bash_completion	Mon Oct 22 21:25:08 2012 +0300
@@ -58,7 +58,7 @@
 _mycd() {
   local cur
   cur=${COMP_WORDS[COMP_CWORD]}
-  if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then
+  if [[ -z "${CDPATH:-}" ]] || [[ $cur == ?(.)?(.)/* ]] || [[ $cur == '~'/* ]]; then
     COMPREPLY=( $(compgen -d -- "$cur") )
     return 0
   fi