all repos — scriptura @ 319bfc4b41d00530088721134a067d172de8bd3a

a corner in $HOME for your scripts

rework completion functions - read root from environment - enable testing by preferring argv over $(commandline -xpc)

Alan Pearce
commit

319bfc4b41d00530088721134a067d172de8bd3a

parent

67c5dc65972ef72d72080ea7792296971c8f388c

1 file changed, 19 insertions(+), 0 deletions(-)

changed files
A functions/__scriptura_complete_script.fish
@@ -0,0 +1,19 @@
+function __scriptura_complete_script + set --function from $SCRIPTURA_ROOT + + test (count $argv) -ne 0 + or set --function argv (commandline -xpc)[2..] + + for arg in $argv + if path is --type dir $from/$arg + set --function from $from/$arg + else if path is --type file $from/$arg + return + end + end + + set --function types file,dir + for entry in $(path filter --type $types --perm exec $from/*) + printf "%s\t%s\n" $(path basename $entry) $(__scriptura_help $entry) + end +end