From 3f0e2ef1dc0186538cc9a8465b265e2abefedb18 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sat, 10 Oct 2020 11:53:57 -0500 Subject: [PATCH] [openssl] Support openssl 1.1.0 completions --- share/completions/openssl.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/completions/openssl.fish b/share/completions/openssl.fish index 676daf853..84163e3bd 100644 --- a/share/completions/openssl.fish +++ b/share/completions/openssl.fish @@ -3,5 +3,9 @@ function __fish_openssl_subcommand_options --description "Print options for open openssl list -options $cmd[2] | string replace -r -- '^(\S*)\s*.*' '-$1' end -complete -c openssl -n __fish_use_subcommand -x -a "(openssl list -1 -commands -cipher-commands -digest-commands)" +if command openssl list -1 2>&1 >/dev/null + complete -c openssl -n __fish_use_subcommand -x -a "(openssl list -1 -commands -cipher-commands -digest-commands)" +else + complete -c openssl -n __fish_use_subcommand -x -a "(openssl help 2>&1 | string match -rv '^[A-Z]|^\$' | string split -n ' ')" +end complete -c openssl -n 'not __fish_use_subcommand && string match -qr -- "^-" (commandline -ct)' -a "(__fish_openssl_subcommand_options)"