mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 03:13:37 +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
|