Files
fish-shell/share/functions/__fish_nth_token.fish
Johannes Altmanninger a53db72564 Mark private functions that don't need localization
See the next commit.

Part of #11833
2025-09-30 11:47:26 +02:00

11 lines
416 B
Fish

# localization: skip(private)
function __fish_nth_token --description 'Prints the Nth token (ignoring command and switches/flags)' --argument-names n
set -l tokens (commandline -px | string replace -r --filter '^([^-].*)' '$1')
# Increment $n by one to account for ignoring the command
if test (count $tokens) -ge (math "$n" + 1)
echo $tokens[(math $n + 1)]
else
return 1
end
end