fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMark private functions that don't need localizationa53db7256

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