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, 8 insertions(+), 6 deletions(-)

changed files
M functions/__scriptura_seen_script.fishfunctions/__scriptura_seen_script.fish
@@ -1,17 +1,19 @@
function __scriptura_seen_script - set --function argv $argv[2..-1] + test (count $argv) -ne 0 + or set --function argv (commandline -xpc)[2..] + set --function target $SCRIPTURA_ROOT if not set --query argv[1] return 1 end - for i in (seq 1 (count $argv)) - if test "$argv[$i]" = -- + for arg in $argv + if test "$arg" = -- break - else if path is --type dir $target/$argv[$i] - set --function target $target/$argv[$i] - else if path is --type file --perm exec $target/$argv[$i] + else if path is --type dir $target/$arg + set --function target $target/$arg + else if path is --type file --perm exec $target/$arg return 0 else break