mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 14:23:09 +00:00
a3e20a4d38
"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".
5 lines
244 B
Fish
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
|