fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
78c948282
master
1if string match -q"OpenSSL*" ( command openssl version) 2# This is real OpenSSL that has the list command. 3function __fish_openssl_subcommand_options --description"Print options for openssl subcommand" 4set -l cmd( commandline -pxc) 5openssl list -options$cmd [ 2 ] | string replace -r --'^(\S*)\s*.*' '-$1' 6end 7 8complete -c openssl -n __fish_use_subcommand -x -a"(openssl list -1 -commands -cipher-commands -digest-commands)" 9complete -c openssl -n'not __fish_use_subcommand && string match -qr -- "^-" (commandline -ct)' -a"(__fish_openssl_subcommand_options)" 10else 11# Perhaps LibreSSL - see #7966 12# TODO: support subcommand options. 13complete -c openssl -n __fish_use_subcommand -x -a"(openssl help 2>&1 | string match -rv '^[A-Z]|^\$|Error' | string split -n ' ')" 14end