mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
6 lines
250 B
Fish
6 lines
250 B
Fish
|
function fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
|
||
|
set -l tokens (commandline -poc)
|
||
|
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
|
||
|
test (count $tokens) -eq "$n"
|
||
|
end
|