fish-shell/share/functions/__fish_is_token_n.fish
Fabian Homborg a3e20a4d38 Don't use abbreviated long options
"function --argument" is not a thing, it's "--argument-names". This only
accidentally works because our getopt is awful and allows abbreviated
long options.

Similarly, one argparse test used "--d" instead of "-d" or "--def".
2020-09-19 11:47:41 +02:00

5 lines
244 B
Fish

function __fish_is_token_n --description 'Test if current token is on Nth place' --argument-names n
# Add a fake element to increment without calling math
set -l num (count (commandline -poc) additionalelement)
test $n -eq $num
end