mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-05 18:07:07 +08:00
c2970f9618
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python. If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
17 lines
401 B
Fish
17 lines
401 B
Fish
# returns 0 only if previous argument is one of the supplied arguments
|
|
function __fish_prev_arg_in
|
|
set -l tokens (commandline -co)
|
|
set -l tokenCount (count $tokens)
|
|
if test $tokenCount -lt 2
|
|
# need at least cmd and prev argument
|
|
return 1
|
|
end
|
|
for arg in $argv
|
|
if string match -q -- $tokens[-1] $arg
|
|
return 0
|
|
end
|
|
end
|
|
|
|
return 1
|
|
end
|