fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_not_contain_opt -d"Checks that a specific option is not in the current command line" 3set -l next_short 4set -l short_opt 5set -l long_opt 6 7for iin $argv 8if test -n " $next_short " 9set next_short 10set short_opt$short_opt $i 11else 12switch $i 13case -s 14set next_short1 15case '-*' 16echo __fish_not_contain_opt: Unknown option$i >&2 17return 1 18 19case '*' 20set long_opt$long_opt $i 21end 22end 23end 24 25for iin $short_opt 26if test -z " $i " 27continue 28end 29 30if string match -qr --"^- $i |^-[^-]* $i " ( commandline -cpx) 31return 1 32end 33 34if string match -qr --"^- $i |^-[^-]* $i " ( commandline -ct) 35return 1 36end 37end 38 39for iin $long_opt 40if test -z " $i " 41continue 42end 43 44if contains -- --$i ( commandline -cpx) 45return 1 46end 47end 48 49return 0 50end