Skip to content

Commit

Permalink
completion: add support for tls-key
Browse files Browse the repository at this point in the history
The tls-key command is missing support for the zsh and bash completion.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
  • Loading branch information
igaw committed Jul 9, 2024
1 parent ab49163 commit 5249914
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
27 changes: 25 additions & 2 deletions completions/_nvme
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -2194,6 +2195,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=(
Expand Down Expand Up @@ -2546,8 +2569,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
Expand Down
7 changes: 6 additions & 1 deletion completions/bash-nvme-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 5249914

Please sign in to comment.