extract completion helper functions
1 file changed, 0 insertions(+), 38 deletions(-)
changed files
M completions/scriptura.fish → completions/scriptura.fish
@@ -40,41 +40,3 @@ complete --command scriptura \ --condition '__scriptura_seen_script $(commandline -xpc)' \ --force-files - -function __scriptura_print --argument-names from - path basename $(path filter --type file,dir --perm exec $from/*) -end - -function __scriptura_complete --argument-names from - for arg in $argv[2..-1] - if path is --type dir $from/$arg - set --function from $from/$arg - end - end - for entry in $(path filter --type file,dir --perm exec $from/*) - printf "%s\t%s\n" $(path basename $entry) $(__scriptura_help $entry) - end -end - -function __scriptura_seen_script - set --function argv $argv[2..-1] - 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]" = -- - 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] - return 0 - else - break - end - end - - return 1 -end