fish-shell/share/functions/__fish_is_token_n.fish

6 lines
229 B
Fish
Raw Normal View History

function __fish_is_token_n --description 'Test if current token is on Nth place' --argument n
2016-02-04 06:23:59 +08:00
# Add a fake element to increment without calling math
set -l num (count (commandline -poc) additionalelement)
test $n -eq $num
end