picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 9decb07891f314e7592c141b7c27158f95231d95
parent 5975eb85414f7f855988fff6b5d7a6c66b36cf3c
Author: Alexander Burger <abu@software-lab.de>
Date:   Thu, 29 Dec 2011 16:59:26 +0100

More bash completion
Diffstat:
Mlib/bash_completion | 4+++-
Mlib/complete.l | 9++++++---
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/bash_completion b/lib/bash_completion @@ -7,7 +7,9 @@ _pil() local cur _get_comp_words_by_ref cur - COMPREPLY=($(pil @lib/complete.l "$cur" -bye)) + COMPREPLY=($(${COMP_WORDS[0]} @lib/complete.l "$cur" -bye)) return 0 } && complete -F _pil pil + +# ex: ts=4 sw=4 et filetype=sh diff --git a/lib/complete.l b/lib/complete.l @@ -3,9 +3,12 @@ (let "Lst" (chop (opt)) (if (= "-" (car "Lst")) - (let "Str" (pack (cdr "Lst")) - (for "Sym" (all) - (and (pre? "Str" "Sym") (prinl "-" "Sym")) ) ) + (let "Pre" (pop '"Lst") + (when (member (car "Lst") '("\"" "'")) + (setq "Pre" (pop '"Lst")) ) + (let "Str" (pack "Lst") + (for "Sym" (all) + (and (pre? "Str" "Sym") (prinl "Pre" "Sym")) ) ) ) (let ("Path" (rot (split "Lst" "/")) "Str" (pack (car "Path"))) (setq "Path" (and (cdr "Path") (pack (glue "/" @) "/"))) (for "Sym" (dir "Path" T)