File 0021-completions-Add-show-topology-tab-completion.patch of Package nvme-cli.26914
From 79c3ca71f583095a308f9c042d19c48a82596834 Mon Sep 17 00:00:00 2001
From: Daniel Wagner <dwagner@suse.de>
Date: Wed, 26 Oct 2022 15:27:11 +0200
Subject: [PATCH] completions: Add show-topology tab completion
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
completions/_nvme | 16 +++++++++++++++-
completions/bash-nvme-completion.sh | 5 ++++-
2 files changed, 19 insertions(+), 2 deletions(-)
--- a/completions/bash-nvme-completion.sh
+++ b/completions/bash-nvme-completion.sh
@@ -100,7 +100,7 @@ readonly _plugin_funcs=(
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
@@ -521,6 +521,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
;;
--- a/completions/_nvme
+++ b/completions/_nvme
@@ -61,6 +61,7 @@
'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'
)
@@ -969,6 +970,19 @@
_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
@@ -979,7 +993,7 @@
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