all repos — scriptura @ 14768d7ac9f8bb751b0571f63a7cd74202e2a119

a corner in $HOME for your scripts

fix for "-- stops argument processing" regression

Alan Pearce
commit

14768d7ac9f8bb751b0571f63a7cd74202e2a119

parent

163c71b4eba9ad76fb28a11a581091ac0177fd07

1 file changed, 36 insertions(+), 36 deletions(-)

changed files
M functions/scriptura.fishfunctions/scriptura.fish
@@ -46,49 +46,49 @@ break
end end - if test $valid -eq 0 - echo "scriptura: don't know what to do with target \"$argv\"" >&2 - return 1 - end - - set --local remaining $argv[(math $valid + 1)..-1] - - if set --query _flag_help - __scriptura_help $target - return $status - end - - if set --query _flag_new - __scriptura_new $target $remaining - return $status - end + if test $valid -gt 0 + set --local remaining $argv[(math $valid + 1)..-1] - if set --query _flag_edit - __scriptura_edit $target - return $status - end + if set --query _flag_help + __scriptura_help $target + return $status + end - if set --query _flag_which - __scriptura_which $target $remaining - return $status - end + if set --query _flag_new + __scriptura_new $target $remaining + return $status + end - if set --query _flag_cat - __scriptura_cat $target - return $status - end + if set --query _flag_edit + __scriptura_edit $target + return $status + end - if set --query script - if path is --perm exec $target - $target $remaining + if set --query _flag_which + __scriptura_which $target $remaining return $status - else - echo "scriptura: $target is not executable" >&2 + end + + if set --query _flag_cat __scriptura_cat $target return $status end - else if path is --type dir $target; and test (count $remaining) -eq 0 - __scriptura_list $target - return $status + + if set --query script + if path is --perm exec $target + $target $remaining + return $status + else + echo "scriptura: $target is not executable" >&2 + __scriptura_cat $target + return $status + end + else if path is --type dir $target; and test (count $remaining) -eq 0 + __scriptura_list $target + return $status + end end + + echo "scriptura: don't know what to do with target \"$argv\"" >&2 + return 1 end