fork/fish-shell

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

Johannes AltmanningerMark private functions that don't need localizationa53db7256

master
431 B17 linesraw
1# localization: skip(private)
2# returns 0 only if previous argument is one of the supplied arguments
3function __fish_prev_arg_in
4    set -l tokens (commandline -cx)
5    set -l tokenCount (count $tokens)
6    if test $tokenCount -lt 2
7        # need at least cmd and prev argument
8        return 1
9    end
10    for arg in $argv
11        if string match -q -- $tokens[-1] $arg
12            return 0
13        end
14    end
15
16    return 1
17end