mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
11 lines
234 B
Fish
11 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
|