Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion completions/_nvme
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ _nvme () {
'version:show the program version'
'ocp:OCP cloud SSD extensions'
'solidigm:Solidigm plug-in extensions'
'fdp:FDP plug-in extensions'
'micron:Micron plug-in extensions'
'dapustor:DapuStor plug-in extensions'
'help:print brief descriptions of all nvme commands'
Expand Down Expand Up @@ -603,6 +604,28 @@ _nvme () {
;;
esac
;;
(fdp)
case ${words[2]} in
(feature)
local _feature
_feature=(
--endgrp-id=':Endurance group ID'
-e':alias for --endgrp-id'
--enable-conf-idx=':FDP configuration index to enable'
-c':alias for --enable-conf-idx'
--disable=':Disable current FDP configuration'
-d':alias for --disable'
--verbose=':Increase output verbosity'
-v':alias for --verbose'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme fdp feature options" _feature
;;
(*)
_files
;;
esac
;;
(dapustor)
case ${words[2]} in
(smart-log-add)
Expand Down Expand Up @@ -2643,7 +2666,10 @@ _nvme () {
-v':alias for --verbose'
--output-format=':Output format: normal|json|binary'
-o ':alias for --output-format'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme rotational-media-info-log" _rmi_log
;;
(changed-alloc-ns-list-log)
local _changed_alloc_ns_list_log
_changed_alloc_ns_list_log=(
Expand Down Expand Up @@ -2768,6 +2794,16 @@ _nvme () {
_arguments '*:: :->subcmds'
_describe -t commands "nvme solidigm options" _solidigm
;;
(fdp)
local _fdp
_fdp=(
feature':Show, enable or disable FDP configuration'
version':Shows the plug-in version'
help':Display this help'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme fdp options" _fdp
;;
(micron)
local micron
_micron=(
Expand Down Expand Up @@ -2824,7 +2860,7 @@ _nvme () {
subsystem-reset ns-rescan get-lba-status dsm discover connect-all connect
dim disconnect disconnect-all gen-hostnqn show-hostnqn tls-key dir-receive
dir-send virt-mgmt rpmb version ocp solidigm dapustor mgmt-addr-list-log
rotational-media-info-log changed-alloc-ns-list-log
rotational-media-info-log changed-alloc-ns-list-log fdp
)
_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
37 changes: 37 additions & 0 deletions completions/bash-nvme-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,41 @@ plugin_solidigm_opts () {
return 0
}

plugin_fdp_opts () {
local opts=""
local compargs=""

local nonopt_args=0
for (( i=0; i < ${#words[@]}-1; i++ )); do
if [[ ${words[i]} != -* ]]; then
let nonopt_args+=1
fi
done

if [ $nonopt_args -eq 3 ]; then
opts="/dev/nvme* "
fi

opts+=" "

case "$1" in
"feature")
opts+=" --endgrp-id= -e --enable-conf-idx= -c \
--disable -d --verbose -v"
;;
"version")
opts+=$NO_OPTS
;;
"help")
opts+=$NO_OPTS
;;
esac

COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )

return 0
}

plugin_transcend_opts () {
local opts=""
local compargs=""
Expand Down Expand Up @@ -1631,6 +1666,7 @@ _nvme_subcmds () {
clear-fw-activate-history vs-fw-activate-history log-page-directory \
vs-drive-info cloud-SSDplugin-version market-log \
smart-log-add temp-stats workload-tracker version help"
[fdp]="feature version help"
[transcend]="healthvalue badblock"
[dapustor]="smart-log-add"
[zns]="id-ctrl id-ns zone-mgmt-recv \
Expand Down Expand Up @@ -1667,6 +1703,7 @@ _nvme_subcmds () {
[dera]="plugin_dera_opts"
[sfx]="plugin_sfx_opts"
[solidigm]="plugin_solidigm_opts"
[fdp]="plugin_fdp_opts"
[transcend]="plugin_transcend_opts"
[dapustor]="plugin_dapustor_opts"
[zns]="plugin_zns_opts"
Expand Down