mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-15 14:34:05 +00:00
10 lines
234 B
Fish
10 lines
234 B
Fish
function __fish_is_token_n --description 'Test if current token is on Nth place' --argument n
|
|
set -l num (count (commandline -poc))
|
|
#if test $cur
|
|
expr $n = $num + 1 > /dev/null
|
|
#else
|
|
#expr $n '=' $num + 1 > /dev/null
|
|
#end
|
|
|
|
|
|
end
|