diff options
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -10,7 +10,12 @@ _diralias () { } diralias () { alias "$(basename "$1")=_diralias $1" - complete -C "f(){ find \"${1%%* }\" -maxdepth 1 -type d -name \"\$2*\" -printf '%f\\n'; }; f" "$(basename "$1")" + # using loose depth from the beginning unnecessarily clutter the offer, + # so this way, albeit complicated, convenient traversal is achieved + # XXX could -G be used instead? + complete -o nospace -C \ + "f(){ find \"${1%%* }/\${2%\${2##*/}}\" -maxdepth 1 -type d -name \"\${2##*/}*\" \ + -printf \"\${2%\${2##*/}}%P\\n\"; }; f" "$(basename "$1")" } _linkalias () { |