fish-shell/share/functions/__fish_is_first_token.fish
Johannes Altmanninger 49c5f96470 Use set -l to force use of a local variable
Bare set overwrites a global/universal variable if it exists.
2020-05-15 08:25:07 +02:00

16 lines
287 B
Fish

function __fish_is_first_token -d 'Test if no non-switch argument has been specified yet'
set -l cmd (commandline -poc)
set -e cmd[1]
for i in $cmd
switch $i
case '-*'
case '*'
return 1
end
end
return 0
end