mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 12:28:39 +08: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".
6 lines
244 B
Fish
6 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
|