]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
completions: Add show-topology tab completion
authorDaniel Wagner <dwagner@suse.de>
Wed, 26 Oct 2022 13:27:11 +0000 (15:27 +0200)
committerDaniel Wagner <dwagner@suse.de>
Wed, 26 Oct 2022 13:35:31 +0000 (15:35 +0200)
Signed-off-by: Daniel Wagner <dwagner@suse.de>
completions/_nvme
completions/bash-nvme-completion.sh

index fc6b9676ce858b3ff41aa7bd51f25f4ba90df46b..16c9b7cb92f9a0e8b7779c78f8675002f8dc9fba 100644 (file)
@@ -63,6 +63,7 @@ _nvme () {
        'lockdown:submit a lockdown command'
        'media-unit-stat-log: retrieve media unit status log pages details'
        'supported-cap-config-log: retrieve support log pages details'
+       'show-topology: show subystem topology'
        'help:print brief descriptions of all nvme commands'
        )
 
@@ -971,6 +972,19 @@ _nvme () {
                        _arguments '*:: :->subcmds'
                        _describe -t commands "nvme fid-support-effects-log options" _fidsupporteffectslog
                        ;;
+               (show-topology)
+                       local _showtopology
+                       _showtopology=(
+                       --output-format=':Output format: normal|json|binary'
+                       -o':alias for --output-format'
+                       --verbose':show infos verbosely'
+                       -v':alias of --verbose'
+                       --ranking=':Ranking order: namespace|ctrl'
+                       -r':alias for --ranking'
+                       )
+                       _arguments '*:: :->subcmds'
+                       _describe -t commands "nvme show-topology options" _showtopology
+                       ;;
                (help)
                        local _h
                        _h=( id-ctrl id-ns list-ns id-iocs create-ns delete-ns attach-ns detach-ns
@@ -981,7 +995,7 @@ _nvme () {
                                 pred-lat-event-agg-log nvm-id-ctrl endurance-event-agg-log lba-status-log
                                 resv-notif-log capacity-mgmt id-domain boot-part-log fid-support-effects-log
                                 supported-log-pages lockdown media-unit-stat-log id-ns-lba-format nvm-id-ns
-                                nvm-id-ns-lba-format supported-cap-config-log
+                                nvm-id-ns-lba-format supported-cap-config-log show-topology
                           )
                        _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
index e8177018aadc1c18f912f611bb60b575e3a76829..f067940a3309e82ff457c929892acd21e8360f55 100644 (file)
@@ -103,7 +103,7 @@ _cmds="list list-subsys id-ctrl id-ns \
        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"
+       supported-cap-config-log dim show-topology"
 
 # Add plugins:
 for plugin in "${!_plugin_subcmds[@]}"; do
@@ -524,6 +524,9 @@ nvme_list_opts () {
                        --key= -k --msg= -d --address= -o --blocks= -b \
                        --target= -t"
                        ;;
+               "show-topology")
+               opts+=" --output-format= -o --verbose -v --ranking= -r"
+                       ;;
                "version")
                opts+=$NO_OPTS
                        ;;