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 ae4df040ad28f8fcc438c667f17f17a4432d3391
parent ece72b2464f29e5bf7cc5b7d48df26c09a895019
Author: Alexander Burger <abu@software-lab.de>
Date:   Thu, 29 Dec 2011 14:03:38 +0100

Added bash completion
Diffstat:
Alib/bash_completion | 13+++++++++++++
Alib/complete.l | 14++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/lib/bash_completion b/lib/bash_completion @@ -0,0 +1,13 @@ +# Bash completion for pil (picolisp front-end) +# Alexander Burger <abu@software-lab.de> + +have pil && +_pil() +{ + local cur + + _get_comp_words_by_ref cur + COMPREPLY=( $(pil @lib/complete.l $cur -bye) ) + return 0 +} && +complete -F _pil pil diff --git a/lib/complete.l b/lib/complete.l @@ -0,0 +1,14 @@ +# 29dec11abu +# (c) Software Lab. Alexander Burger + +(let "Lst" (chop (opt)) + (if (= "-" (car "Lst")) + (let "Str" (pack (cdr "Lst")) + (for "Sym" (all) + (and (pre? "Str" "Sym") (prinl "-" "Sym")) ) ) + (let ("Path" (rot (split "Lst" "/")) "Str" (pack (car "Path"))) + (setq "Path" (and (cdr "Path") (pack (glue "/" @) "/"))) + (for "Sym" (dir "Path" T) + (and (pre? "Str" "Sym") (prinl "Path" "Sym")) ) ) ) ) + +# vi:et:ts=3:sw=3