From 2020bb770552cd4bc0845ab1ec7c7f55da2c06c0 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Thu, 4 Jul 2024 19:17:46 +0200 Subject: [PATCH] completion: add support for tls-key The tls-key command is missing support for the zsh and bash completion. Signed-off-by: Daniel Wagner --- completions/_nvme | 27 +++++++++++++++++++++++++-- completions/bash-nvme-completion.sh | 7 ++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/completions/_nvme b/completions/_nvme index af29086a7..b8968ec7a 100644 --- a/completions/_nvme +++ b/completions/_nvme @@ -97,6 +97,7 @@ _nvme () { 'disconnect-all:disconnect from all connected NVMeoF subsystems' 'gen-hostnqn:generate a host NVMe Qualified Name' 'show-hostnqn:show the host NQN configured for the system' + 'tls-key:manipulate NVMeoF TLS PSK' 'dir-receive:read directive parameters of the specified directive type' 'dir-send:set directive parameters of the specified directive type' 'virt-mgmt:submit a Virtualization Management command' @@ -2190,6 +2191,28 @@ _nvme () { _arguments '*:: :->subcmds' _describe -t commands "nvme show-hostnqn options" _show_hostnqn ;; + (tls-key) + local _tls_key + _tls_key=( + --verbose':show infos verbosely' + -v':alias of --verbose' + --output-format=':Output format: normal|json|binary' + -o':alias for --output-format' + --keyring=':name for keyring' + -r':alias for --keyring' + --keytype=':type for the key' + -t':alias for --keytype' + --keyfile='filename for reading/writing keys from' + -f':alias for --keyfile' + --import'import all keys into keyring' + -i':alias for --import' + --export'export all keys from keyring' + -e':alias for --export' + --revoke'revoke key from keyring' + -r':alias for --revoke' + ) + _arguments '*:: :->subcmds' + _describe -t commands "nvme tls-key options" _tls_key (dir-receive) local _dir_receive _dir_receive=( @@ -2542,8 +2565,8 @@ _nvme () { effects-log endurance-log device-self-test self-test-log set-property get-property write-zeroes write-uncor verify sanitize sanitize-log reset subsystem-reset ns-rescan get-lba-status dsm discover connect-all connect - dim disconnect disconnect-all gen-hostnqn show-hostnqn dir-receive dir-send - virt-mgmt rpmb version ocp solidigm + dim disconnect disconnect-all gen-hostnqn show-hostnqn tls-key dir-receive + dir-send virt-mgmt rpmb version ocp solidigm ) _arguments '*:: :->subcmds' _describe -t commands "help: infos on a specific nvme command, or provide no option to see a synopsis of all nvme commands" _h diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh index 9f9d60b84..49e60b77e 100644 --- a/completions/bash-nvme-completion.sh +++ b/completions/bash-nvme-completion.sh @@ -427,6 +427,11 @@ nvme_list_opts () { "show-hostnqn") opts+=$NO_OPTS ;; + "tls-key") + opts+=" --output-format= -o --verbose -v --keyring -k \ + --keytype= -k --keyfile= -f --import -i \ + --export= -e --revoke= -r" + ;; "dir-receive") opts+=" --namespace-id= -n --data-len= -l --raw-binary -b \ --dir-type= -D --dir-spec= -S --dir-oper= -O \ @@ -1603,7 +1608,7 @@ _nvme_subcmds () { sanitize sanitize-log reset subsystem-reset \ ns-rescan show-regs discover connect-all \ connect disconnect disconnect-all gen-hostnqn \ - show-hostnqn dir-receive dir-send virt-mgmt \ + show-hostnqn tls-key dir-receive dir-send virt-mgmt \ rpmb boot-part-log fid-support-effects-log \ supported-log-pages lockdown media-unit-stat-log \ supported-cap-config-log dim show-topology list-endgrp \