mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
Undunder __fish_is_nth_token
We keep __fish_is_nth_token for compatibility and edit the implementations of __fish_is_nth_token, __fish_is_first_token and __fish_is_token_n to use fish_is_nth_token
This commit is contained in:
committed by
Fabian Homborg
parent
859edc9c2c
commit
0445126c2e
@@ -1,6 +1,3 @@
|
||||
function __fish_is_nth_token
|
||||
set -l n $argv[1]
|
||||
set -l tokens (commandline -poc)
|
||||
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
|
||||
test (count $tokens) -eq "$n"
|
||||
function __fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
|
||||
fish_is_nth_token $n
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user