]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
completions: Add nvme-mi-recv nad nvme-mi-send commands completions
authorTokunori Ikegami <ikegami.t@gmail.com>
Sat, 14 Oct 2023 05:40:09 +0000 (14:40 +0900)
committerDaniel Wagner <wagi@monom.org>
Thu, 2 Nov 2023 15:52:58 +0000 (16:52 +0100)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
completions/_nvme
completions/bash-nvme-completion.sh

index b12f1800341e1169f08e06f7b6e3c5ccd1bbd133..a9bd6e2b362cbf30671197c451a34bb41301b8e5 100644 (file)
@@ -102,6 +102,8 @@ _nvme () {
        'virt-mgmt:submit a Virtualization Management command'
        'rpmb:submit an NVMe RPMB command'
        'show-topology:show subsystem topology'
+       'nvme-mi-recv:send a NVMe-MI receive command'
+       'nvme-mi-send:send a NVMe-MI send command'
        'version:show the program version'
        'ocp:OCP cloud SSD extensions'
        'help:print brief descriptions of all nvme commands'
@@ -1998,6 +2000,48 @@ _nvme () {
                        _arguments '*:: :->subcmds'
                        _describe -t commands "nvme show-topology options" _showtopology
                        ;;
+               (nvme-mi-recv)
+                       local _nvme_mi_recv
+                       _nvme_mi_recv=(
+                       --opcode=':NVMe-MI opcode to send'
+                       -O':alias of --opcode'
+                       --namespace-id=':value for nsid'
+                       -n':alias of --namespace-id'
+                       --data-len=':length for data buffer'
+                       -l':alias of --data-len'
+                       --nmimt':value for NVMe-MI message type'
+                       -m':alias of --nmimt'
+                       --nmd0':value for NVMe management request dword 0'
+                       -0':alias of --nmd0'
+                       --nmd1':value for NVMe management request dword 1'
+                       -1':alias of --nmd1'
+                       --input-file=':defaults to stdin; input for write (send direction)'
+                       -i':alias for --input-file'
+                       )
+                       _arguments '*:: :->subcmds'
+                       _describe -t commands "nvme nvme-mi-recv options" _nvme_mi_recv
+                       ;;
+               (nvme-mi-send)
+                       local _nvme_mi_send
+                       _nvme_mi_send=(
+                       --opcode=':NVMe-MI opcode to send'
+                       -O':alias of --opcode'
+                       --namespace-id=':value for nsid'
+                       -n':alias of --namespace-id'
+                       --data-len=':length for data buffer'
+                       -l':alias of --data-len'
+                       --nmimt':value for NVMe-MI message type'
+                       -m':alias of --nmimt'
+                       --nmd0':value for NVMe management request dword 0'
+                       -0':alias of --nmd0'
+                       --nmd1':value for NVMe management request dword 1'
+                       -1':alias of --nmd1'
+                       --input-file=':defaults to stdin; input for write (send direction)'
+                       -i':alias for --input-file'
+                       )
+                       _arguments '*:: :->subcmds'
+                       _describe -t commands "nvme nvme-mi-send options" _nvme_mi_send
+                       ;;
                (version)
                        local _version
                        _version=(
index f6f1fadce7af200356d386ec23229e14356d2918..2ae4a1e26710be514b3c8f59f53c818e725f3ae2 100644 (file)
@@ -445,6 +445,14 @@ nvme_list_opts () {
                "show-topology")
                opts+=" --output-format= -o --verbose -v --ranking= -r"
                        ;;
+               "nvme-mi-recv")
+               opts+=" --opcode= -O --namespace-id= -n --data-len= -l \
+                       --nmimt= -m --nmd0= -0 --nmd1= -1 --input-file= -i"
+                       ;;
+               "nvme-mi-send")
+               opts+=" --opcode= -O --namespace-id= -n --data-len= -l \
+                       --nmimt= -m --nmd0= -0 --nmd1= -1 --input-file= -i"
+                       ;;
                "version")
                opts+=$NO_OPTS
                        ;;
@@ -1469,7 +1477,8 @@ _nvme_subcmds () {
                show-hostnqn 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"
+               supported-cap-config-log dim show-topology list-endgrp \
+               nvme-mi-recv nvme-mi-send"
 
        # Add plugins:
        for plugin in "${!_plugin_subcmds[@]}"; do