summaryrefslogtreecommitdiffstats
path: root/completions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:41:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:41:32 +0000
commitf26f66d866ba1a9f3204e6fdfe2b07e67b5492ad (patch)
treec953c007cbe4f60a147ab62f97937d58abb2e9ca /completions
parentInitial commit. (diff)
downloadnvme-cli-f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad.tar.xz
nvme-cli-f26f66d866ba1a9f3204e6fdfe2b07e67b5492ad.zip
Adding upstream version 2.8.upstream/2.8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions')
-rw-r--r--completions/README120
-rw-r--r--completions/_nvme2316
-rw-r--r--completions/bash-nvme-completion.sh1604
3 files changed, 4040 insertions, 0 deletions
diff --git a/completions/README b/completions/README
new file mode 100644
index 0000000..ba1032a
--- /dev/null
+++ b/completions/README
@@ -0,0 +1,120 @@
+Kelly Kaoudis, kelly.n.kaoudis at intel.com, June 2015
+
+Setting Up NVMe Tab Autocompletion for bash or zsh
+==================================================
+
+If your working shell is bash...
+--------------------------------
+the following gets bash autocompletion to behave properly
+#echo "bind 'set show-all-if-ambiguous on'" >> ~/.bashrc
+#echo "bind 'set show-all-if-unmodified on'" >> ~/.bashrc
+#echo "bind 'set completion-ignore-case on'" >> ~/.bashrc
+#echo "bind 'set completion-map-case on'" >> ~/.bashrc
+
+add NVMe autocompletion script to your autocompletes directory
+#cp `pwd`/bash-nvme-completion.sh /etc/bash_completion.d/nvme
+
+make sure this bash knows where everything is
+#source /etc/bash_completion.d/nvme && source ~/.bashrc
+
+you should be able to autocomplete with the nvme utility now
+(double TABs still apply)! If autocompleting has disappeared,
+just re-source nvme and .bashrc. To see a full list of auto-completable
+NVMe commands, type "nvme help " and hit TAB.
+
+You may also need to uncomment the "enable bash completion in interactive
+shells" part of /etc/bash.bashrc, which hopefully looks something like:
+
+if [ -f /usr/share/bash-completion/bash_completion ]; then
+ . /usr/share/bash-completion/bash_completion
+elif [ -f /etc/bash_completion ]; then
+ . /etc/bash_completion
+fi
+
+(don't bother with the shopt part, your Bash version might not support shopt).
+
+Bash footnote: for bash vers >= 4.2, it appears to be the case that
+menu-complete **no longer works.** If the bash dev folks ever re-patch this,
+try binding TAB to menu-complete to cycle through the NVMe subcommand matches
+on whatever you typed.
+
+if your working shell is zsh...
+-------------------------------
+create the zsh completions directory if you don't have it
+#if [ ! -e "~/.zsh" ]; then
+# mkdir ~/.zsh
+# mkdir ~/.zsh/completion
+#fi
+
+#cp `pwd`/_nvme ~/.zsh/completion/_nvme
+
+add compinit if you don't have it in your .zshrc
+#echo "autoload -Uz compinit && compinit" >> ~/.zshrc
+
+add nvme autocompletions to your .zshrc
+#echo "# source for tab autocompletions" >> ~/.zshrc
+#echo "fpath=(~/.zsh/completion $fpath)" >> ~/.zshrc
+#echo "source ~/.zsh/completion/_nvme" >> ~/.zshrc
+
+make sure this zsh knows where everything is
+#source ~/.zsh/completion/_nvme && source ~/.zshrc
+
+You should be able to autocomplete with the nvme utility now (single TAB press
+should get you a completion with descriptions -- sadly, bash doesn't support
+descriptions within completions). If autocompletes disappear, just re-source
+_nvme and .zshrc. Also, make sure your .zshrc is ordered correctly: we want to
+source _nvme before updating our fpath. Both of these should occur before
+compinit is loaded.
+
+Updating NVMe Tab Autocompletions
+=================================
+
+zsh
+---
+
+Add your new command to the _cmds array in the following format:
+
+'command:short-form description'
+
+Add a case to the zsh case statement for autocompletion of subopts
+in the following format (as seen in _nvme):
+
+(bar)
+ local _list_of_subopts
+ _list_of_subopts=(
+ /dev/nvme':supply a device to use (required)'
+ --foo':do something cool'
+ -f':alias of --foo'
+ )
+
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme bar options" _list_of_subopts
+ ;;
+
+All zsh autocompletion built-ins start with _, and so should anything
+internal to your autocompletes. _arguments and _describe are built-ins.
+The '*:: :->subcmds' bit describes the format in which we want our
+options to be displayed (don't change this, unless you like pain.)
+_describe -t adds our list of options to the data structure associated with
+our command `bar'.
+
+Add the name of your command to the (help) case as well.
+
+Update your ~/.zsh/completion/_nvme with your new changes and re-source as needed.
+
+bash
+----
+
+Add the name of your command to _cmds in bash_nvme_completion.sh. Add a case to
+_nvme_list_opts in the following format:
+
+"bar")
+opts+="--foo= -f --baz= -b"
+;;
+
+Update your /etc/bash_completion.d/nvme version, and re-source things as needed.
+
+TO DO
+-----
+Automatically generate man pages and autocompletions for new NVMe commands, possibly
+with kerneldoc.
diff --git a/completions/_nvme b/completions/_nvme
new file mode 100644
index 0000000..e90fc42
--- /dev/null
+++ b/completions/_nvme
@@ -0,0 +1,2316 @@
+#compdef _nvme nvme
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# zsh completions for the nvme command-line interface,
+# very loosely based on git and adb command completion
+# Kelly Kaoudis kelly.n.kaoudis at intel.com, June 2015
+
+_nvme () {
+ local -a _cmds
+ _cmds=(
+ 'list:identify basic information for all NVMe namespaces'
+ 'list-subsys:identify information for subsystems'
+ 'id-ctrl:display information about the controller'
+ 'id-ns:display information about the namespace'
+ 'id-ns-granularity:display namespace granularity list'
+ 'id-ns-lba-format:display information about the namespace capability fields for specific LBA format'
+ 'list-ns:identify all namespace(s) attached'
+ 'cmdset-ind-id-ns:display I/O Command Set Independent information about the namespace'
+ 'id-iocs:display information about I/O command sets'
+ 'id-domain:display information about domain list'
+ 'create-ns:create a new namespace before attachment'
+ 'delete-ns:delete a detached namespace'
+ 'attach-ns:attach namespace to controller'
+ 'detach-ns:detach namespace from controller'
+ 'list-ctrl:identify all controller(s) attached'
+ 'nvm-id-ctrl:display information about the nvm command set'
+ 'nvm-id-ns:display information about the namespace of nvm command set'
+ 'nvm-id-ns-lba-format:display information about the namespace of nvm command set capability fields for specific LBA format'
+ 'primary-ctrl-caps:display primary controller capabilities'
+ 'list-secondary:identify secondary controller list associated with the primary controller'
+ 'ns-descs:display namespace identification descriptors'
+ 'id-nvmset:display entries for NVM Set identifiers'
+ 'id-uuid:display list of supported Vendor Specific UUIDs'
+ 'list-endgrp:display information about nvme endurance group list'
+ 'get-ns-id:get namespace id of opened block device'
+ 'get-log:retrieve any log in raw format'
+ 'predictable-lat-log:retrieve predictable latency per nvmset log'
+ 'pred-lat-event-agg-log:retrieve predictable latency event aggregate log'
+ 'persistent-event-log:retrieve persistent event log'
+ 'telemetry-log:retrieve telemetry log'
+ 'fw-log:retrieve fw log'
+ 'changed-ns-list-log:retrieve changed namespaces log'
+ 'smart-log:retrieve SMART log'
+ 'smart-log-add:retrieve additional SMART log'
+ 'ana-log:retrieve ANA log'
+ 'error-log:retrieve error log'
+ 'effects-log:retrieve command effects log page and print the table'
+ 'endurance-log:retrieves endurance groups log page and prints the log'
+ 'endurance-event-agg-log:retrieve endurance group event aggregate log'
+ 'lba-status-log:retrieve lba status log'
+ 'resv-notif-log:retrieve reservation notification log'
+ 'get-feature:display a controller feature'
+ 'device-self-test:implementing the device self-test feature'
+ 'self-test-log:retrieve the self-test log'
+ 'set-feature:set a controller feature and show results'
+ 'set-property:writes and shows the defined NVMe controller property for NVMe over Fabric'
+ 'get-property:Reads and shows the defined NVMe controller property for NVMe over Fabric'
+ 'format:apply new block format to namespace'
+ 'fw-activate:activate a firmware on the device'
+ 'fw-download:download a firmware to the device'
+ 'admin-passthru:submit a passthrough admin command IOCTL'
+ 'io-passthru:submit a passthrough io command IOCTL'
+ 'security-send:send security/secure data to controller'
+ 'security-recv:ask for security/secure data from controller'
+ 'get-lba-status:display information about potentially unrecoverable LBAs'
+ 'resv-acquire:acquire reservation on a namespace'
+ 'resv-register:register reservation on a namespace'
+ 'resv-release:release reservation on a namespace'
+ 'resv-report:report reservation on a namespace'
+ 'dsm:submit a Data Set Management command'
+ 'copy:submit a simple copy command'
+ 'flush:submit a flush'
+ 'compare:compare data on device to data elsewhere'
+ 'read:submit a read command'
+ 'write:submit a write command'
+ 'capacity-mgmt:submit capacity management command'
+ 'write-zeroes:submit an NVMe write zeroes command'
+ 'write-uncor:submit an NVMe write uncorrectable command'
+ 'verify:submit an NVMe Verify command'
+ 'sanitize:submit a sanitize command'
+ 'sanitize-log:retrieve sanitize log and show it'
+ 'reset:reset the NVMe controller'
+ 'subsystem-reset:reset the NVMe subsystem'
+ 'ns-rescan:rescan the NVMe namespaces'
+ 'show-regs:show the controller registers; require admin character device'
+ 'boot-part-log:retrieve boot partition log'
+ 'fid-support-effects-log:retrieve fid support and effects log'
+ 'supported-log-pages:retrieve support log pages details'
+ 'lockdown:submit a lockdown command'
+ 'media-unit-stat-log:retrieve media unit status log pages details'
+ 'supported-cap-config-log:retrieve the list of Supported Capacity Configuration Descriptors'
+ 'discover:send Get Log Page request to Discovery Controller'
+ 'connect-all:discover NVMeoF subsystems and connect to them'
+ 'connect:connect to NVMeoF subsystem'
+ 'dim:send Discovery Information Management command to a Discovery Controller (DC)'
+ 'disconnect:disconnect from NVMeoF subsystem'
+ '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'
+ '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'
+ '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'
+ 'solidigm:Solidigm plug-in extensions'
+ 'help:print brief descriptions of all nvme commands'
+ 'json:dump output in json format'
+ )
+
+ local expl
+
+ _arguments '*:: :->subcmds' && return 0
+
+ if (( CURRENT == 1 )); then
+ _describe -t commands "nvme subcommands" _cmds
+ return
+ elif (( CURRENT > 2 )); then
+ case ${words[1]} in
+ (ocp)
+ case ${words[2]} in
+ (smart-add-log)
+ local _smart_add_log
+ _smart_add_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp smart-add-log options" _smart_add_log
+ ;;
+ (latency-monitor-log)
+ local _latency_monitor_log
+ _latency_monitor_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp latency-monitor-log options" _latency_monitor_log
+ ;;
+ (set-latency-monitor-feature)
+ local _set_latency_monitor_feature
+ _set_latency_monitor_feature=(
+ /dev/nvme':supply a device to use (required)'
+ --active_bucket_timer_threshold=':Active Bucket Timer Threshold'
+ -t':alias for --active_bucket_timer_threshold'
+ --active_threshold_a=':Active Threshold A'
+ -a':alias for --active_threshold_a'
+ --active_threshold_a=':Active Threshold B'
+ -b':alias for --active_threshold_b'
+ --active_threshold_c=':Active Threshold C'
+ -c':alias for --active_threshold_c'
+ --active_threshold_d=':Active Threshold D'
+ -d':alias for --active_threshold_d'
+ --active_latency_config=':Active Latency Configuration'
+ -f':alias for --active_latency_config'
+ --active_latency_minimum_window=':Active Latency Minimum Window'
+ -w':alias for --active_latency_minimum_window'
+ --debug_log_trigger_enable='Debug Log Trigger Enable'
+ -r':alias for --debug_log_trigger_enable'
+ --discard_debug_log='Discard Debug Log'
+ -l':alias for --discard_debug_log'
+ --latency_monitor_feature_enable='Latency Monitor Feature Enable'
+ -e':alias for --latency_monitor_feature_enable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp set-latency-monitor-feature options" _set_latency_monitor_feature
+ ;;
+ (internal-log)
+ local _internal_log
+ _internal_log=(
+ /dev/nvme':supply a device to use (required)'
+ --telemetry_type=':Telemetry Type; host (Create bit) or controller'
+ -t':alias for --telemetry_type'
+ --telemetry_data_area=':Telemetry Data Area; 1 or 3'
+ -a':alias for --telemetry_data_area'
+ --output-file=':Output file name with path'
+ -o':alias for --output-file'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp internal-log options" _internal_log
+ ;;
+ (clear-fw-activate-history)
+ local _clear_fw_activate_history
+ _clear_fw_activate_history=(
+ /dev/nvme':supply a device to use (required)'
+ --no-uuid':Skip UUID index search'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp clear-fw-activate-history options" _clear_fw_activate_history
+ ;;
+ (eol-plp-failure-mode)
+ local _eol_plp_failure_mode
+ _eol_plp_failure_mode=(
+ /dev/nvme':supply a device to use (required)'
+ --mode=':0-3: default/rom/wtm/normal'
+ -m':alias for --mode'
+ --save':Specifies that the controller shall save the attribute'
+ -s':alias for --save'
+ --sel=':0-3,8: current/default/saved/supported/changed:'
+ -S':alias for --sel'
+ --no-uuid':Skip UUID index search'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp eol-plp-failure-mode options" _eol_plp_failure_mode
+ ;;
+ (clear-pcie-correctable-error-counters)
+ local _clear_pcie_correctable_error_counters
+ _clear_pcie_correctable_error_counters=(
+ /dev/nvme':supply a device to use (required)'
+ --no-uuid':Skip UUID index search'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp clear-pcie-correctable-error-counters options" _clear_pcie_correctable_error_counters
+ ;;
+ (fw-activate-history)
+ local _fw_activate_history
+ _fw_activate_history=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp fw-activate-history options" _fw_activate_history
+ ;;
+ (device-capability-log)
+ local _device_capability_log
+ _device_capability_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp device-capability-log options" _device_capability_log
+ ;;
+ (set-dssd-power-state-feature)
+ local _set_dssd_power_state_feature
+ _set_dssd_power_state_feature=(
+ /dev/nvme':supply a device to use (required)'
+ --power-state=':DSSD Power State to set in watts'
+ -p':alias for --power-state'
+ --save':Specifies that the controller shall save the attribute'
+ -s':alias for --save'
+ --no-uuid':Skip UUID index search'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp set-dssd-power-state-feature options" _set_dssd_power_state_feature
+ ;;
+ (telemetry-string-log)
+ local _telemetry_string_log
+ _telemetry_string_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-file=':Output file name with path'
+ -o':alias for --output-file'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp telemetry-string-log options" _telemetry_string_log
+ ;;
+ (*)
+ _files
+ ;;
+ esac
+ ;;
+ (solidigm)
+ case ${words[2]} in
+ (id-ctrl)
+ local _id_ctrl
+ _id_ctrl=(
+ --verbose':Increase output verbosity'
+ -v':alias for --verbose'
+ --output-format':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --vendor-specific':dump binary vendor field'
+ -V':alias for --vendor-specific'
+ --raw-binary':show identify in binary format'
+ -b':alias for --raw-binary'
+ --human-readable':show identify in readable format'
+ -H':alias for --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm id-ctrl options" _id_ctrl
+ ;;
+ (smart-log-add)
+ local _smart_log_add
+ _smart_log_add=(
+ --namespace-id':(optional) desired namespace'
+ -n':alias for --namespace-id'
+ --output-format':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm smart-log-add options" _smart_log_add
+ ;;
+ (vs-smart-add-log)
+ local _vs_smart_add_log
+ _vs_smart_add_log=(
+ --output-format':output Format: normal|json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm vs-smart-add-log options" _vs_smart_add_log
+ ;;
+ (vs-internal-log)
+ local _vs_internal_log
+ _vs_internal_log=(
+ --type':Log type: ALL,
+ CONTROLLERINITTELEMETRY,
+ HOSTINITTELEMETRY,
+ HOSTINITTELEMETRYNOGEN, NLOG,
+ ASSERT, EVENT. Defaults to ALL.'
+ -t':alias for --type'
+ --namespace-id':Namespace to get logs from.'
+ -n':alias for --namespace-id'
+ --dir-prefix':Output dir prefix; defaults to device serial number.'
+ -p':alias for --dir-prefix'
+ --verbose':To print out verbose info.'
+ -v':alias for --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm vs-internal-log" _vs_internal_log
+ ;;
+ (garbage-collect-log)
+ local _garbage_collect_log
+ _garbage_collect_log=(
+ --output-format':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm garbage-collect-log" _garbage_collect_log
+ ;;
+ (market-log)
+ local _market_log
+ _market_log=(
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm market-log" _market_log
+ ;;
+ (latency-tracking-log)
+ local _latency_tracking_log
+ _latency_tracking_log=(
+ --enable':Enable Latency Tracking'
+ -e':alias for --enable'
+ --disable':Disable Latency Tracking'
+ -d':alias for --disable'
+ --read':Get read statistics'
+ -r':alias for --read'
+ --write':Get write statistics'
+ -w':alias for --write'
+ --type':Log type to get'
+ -t':alias for --type'
+ --output-format':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm latency-tracking-log" _latency_tracking_log
+ ;;
+ (parse-telemetry-log)
+ local _parse_telemetry_log
+ _parse_telemetry_log=(
+ --host-generate':Controls when to generate new
+ host initiated report. Default
+ value '1' generates new host
+ initiated report, value '0'
+ causes retrieval of existing
+ log.'
+ -g':alias for --host-generate'
+ --controller-init':Gather report generated by the controller.'
+ -c':alias for --controller-init'
+ --data-area':Pick which telemetry data area to
+ report. Default is 3 to fetch
+ areas 1-3. Valid options are 1,
+ 2, 3, 4.'
+ -d':alias for --data-area'
+ --config-file':JSON configuration file'
+ -j':alias for --config-file'
+ --source-file':data source <device> is binary
+ file containing log dump instead
+ of block or character device'
+ -s':alias for --source-file'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm parse-telemetry-log" _parse_telemetry_log
+ ;;
+ (clear-pcie-correctable-errors)
+ local _clear_pcie_correctable_errors
+ _clear_pcie_correctable_errors=(
+ --no-uuid':Skip UUID index search (UUID index not required for OCP 1.0)'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm clear-pcie-correctable-errors" _clear_pcie_correctable_errors
+ ;;
+ (clear-fw-activate-history)
+ local _clear_fw_activate_history
+ _clear_fw_activate_history=(
+ --no-uuid':Skip UUID index search (UUID index not required for OCP 1.0)'
+ -n':alias for --no-uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm clear-fw-activate-history" _clear_fw_activate_history
+ ;;
+ (vs-fw-activate-history)
+ local _vs_fw_activate_history
+ _vs_fw_activate_history=(
+ --output-format':output format : normal | json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm vs-fw-activate-history" _vs_fw_activate_history
+ ;;
+ (log-page-directory)
+ local _log_page_directory
+ _log_page_directory=(
+ --output-format':output format : normal | json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm log-page-directory" _log_page_directory
+ ;;
+ (temp-stats)
+ local _temp_stats
+ _temp_stats=(
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm temp-stats" _temp_stats
+ ;;
+ (vs-drive-info)
+ local _vs_drive_info
+ _vs_drive_info=(
+ --output-format':output format : normal | json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm vs-drive-info" _vs_drive_info
+ ;;
+ (*)
+ _files
+ ;;
+ esac
+ ;;
+ (sanitize)
+ case ${words[CURRENT-1]} in
+ (--sanact=|-a)
+ _values '' 'exit-failure' 'start-block-erase' 'start-overwrite' 'start-crypto-erase'
+ ;;
+ (*)
+ _files
+ ;;
+ esac
+ ;;
+ (*)
+ _files
+ ;;
+ esac
+ return
+ else
+ case ${words[CURRENT-1]} in
+ (list)
+ local _list
+ _list=(
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list options" _list
+ ;;
+ (list-subsys)
+ local _listsubsys
+ _listsubsys=(
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list-subsys options" _listsubsys
+ ;;
+ (id-ctrl)
+ local _idctrl
+ _idctrl=(
+ /dev/nvme':supply a device to use (required)'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ --vendor-specific':also dump binary vendor infos'
+ -V':alias of --vendor-specific'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-ctrl options" _idctrl
+ ;;
+ (id-ns)
+ local _idns
+ _idns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ --vendor-specific':also dump binary vendor infos'
+ -V':alias of --vendor-specific'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-ns options" _idns
+ ;;
+ (id-ns-granularity)
+ local _idns_granularity
+ _idns_granularity=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-ns-granularity options" _idns_granularity
+ ;;
+ (id-ns-lba-format)
+ local _idns_lba_format
+ _idns_lba_format=(
+ /dev/nvme':supply a device to use (required)'
+ --lba-format-index=':show infos for lba format index <lba-format-index>'
+ -i':alias of --lba-format-index'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-ns-lba-format options" _idns_lba_format
+ ;;
+ (list-ns)
+ local _listns
+ _listns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':start namespace infos listing with this nsid'
+ -n':alias of --namespace-id'
+ --csi=':command set identifier'
+ -y':alias of --csi'
+ --all':show all namespaces in the subsystem, whether attached or inactive'
+ -a':alias of --all'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list-ns options" _listns
+ ;;
+ (cmdset-ind-id-ns)
+ local _cmdset_ind_idns
+ _cmdset_ind_idns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme cmdset-ind-id-ns options" _cmdset_ind_idns
+ ;;
+ (id-iocs)
+ local _idiocs
+ _idiocs=(
+ /dev/nvme':supply a device to use (required)'
+ --controller-id=':show infos for controller <cntid>'
+ -c':alias of --controller-id'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-iocs options" _idiocs
+ ;;
+ (id-domain)
+ local _iddomain
+ _iddomain=(
+ /dev/nvme':supply a device to use (required)'
+ --dom-id=':show infos for domain id <cntid>'
+ -d':alias of --dom-id'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-domain options" _iddomain
+ ;;
+ (nvm-id-ctrl)
+ local _nvmidctrl
+ _nvmidctrl=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme nvm-id-ctrl options" _nvmidctrl
+ ;;
+ (nvm-id-ns)
+ local _nvmidns
+ _nvmidns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme nvm-id-ns options" _nvmidns
+ ;;
+ (nvm-id-ns-lba-format)
+ local _nvm_idns_lba_format
+ _nvm_idns_lba_format=(
+ /dev/nvme':supply a device to use (required)'
+ --lba-format-index=':show infos for lba format index <lba-format-index>'
+ -i':alias of --lba-format-index'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme nvm-id-ns-lba-format options" _nvm_idns_lba_format
+ ;;
+ (primary-ctrl-caps)
+ local _primary_ctrl_caps
+ _primary_ctrl_caps=(
+ /dev/nvme':supply a device to use (required)'
+ --cntlid=':show infos for controller <cntid>'
+ -c':alias of --cntlid'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme primary-ctrl-caps options" _primary_ctrl_caps
+ ;;
+ (list-secondary)
+ local _listsecondary
+ _listsecondary=(
+ /dev/nvme':supply a device to use (required)'
+ --cntid=':show infos for lowest controller <cntid>'
+ -c':alias of --cntid'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --num-entries=':number of entries to retrieve'
+ -e':alias of --num-entries'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list-secondary options" _listsecondary
+ ;;
+ (ns-descs)
+ local _ns_descs
+ _ns_descs=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ns-descs options" _ns_descs
+ ;;
+ (id-nvmset)
+ local _id_nvmset
+ _id_nvmset=(
+ /dev/nvme':supply a device to use (required)'
+ --nvmset_id=':NVM Set Identify value'
+ -i':alias of --nvmset_id'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-nvmset options" _id_nvmset
+ ;;
+ (id-uuid)
+ local _id_uuid
+ _id_uuid=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme id-uuid options" _id_uuid
+ ;;
+ (list-endgrp)
+ local _listendgrp
+ _listendgrp=(
+ /dev/nvme':supply a device to use (required)'
+ --endgrp-id=':endurance group id'
+ -i':alias of --endgrp-id'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list-endgrp options" _listendgrp
+ ;;
+ (create-ns)
+ local _createns
+ _createns=(
+ /dev/nvme':supply a device to use (required)'
+ --nsze=':namespace size to create'
+ -s':alias of --nsze'
+ --ncap=':namespace capacity'
+ -c':alias of --ncap'
+ --flbas=':FLBA size'
+ -f':alias of --flbas'
+ --dps=':data protection?'
+ -d':alias of --dps'
+ --nmic=':multipath and sharing'
+ -m':alias of --nmic'
+ --anagrp-id=':ANA Group Identifier'
+ -a':alias of --anagrp-id'
+ --nvmset-id=':NVM Set Identifier'
+ -i':alias of --nvmset-id'
+ --endg-id=':Endurance Group Identifier'
+ -e':alias of --endg-id'
+ --block-size=':target block size'
+ -b':alias of --block-size'
+ --timeout=':value for timeout'
+ -t':alias of --timeout'
+ --csi=':command set identifier'
+ -y':alias of --csi'
+ --lbstm=':logical block storage tag mask'
+ -l':alias of --lbstm'
+ --nsze-si=':size of ns (NSZE) in standard SI units'
+ -S':alias of --nsze-si'
+ --ncap-si=':capacity of ns (NCAP) in standard SI units'
+ -C':alias of --ncap-si'
+ --azr=':Allocate ZRWA Resources (AZR) for Zoned Namespace Command Set'
+ -z':alias of --azr'
+ --rar=':Requested Active Resources (RAR) for Zoned Namespace Command Set'
+ -r':alias of --rar'
+ --ror=':Requested Open Resources (ROR) for Zoned Namespace Command Set'
+ -O':alias of --ror'
+ --rnumzrwa=':Requested Number of ZRWA Resources (RNUMZRWA) for Zoned Namespace Command Set'
+ -u':alias of --rnumzrwa'
+ --phndls=':Comma separated list of Placement Handle Associated RUH'
+ -p':alias of --phndls'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme create-ns options" _createns
+ ;;
+ (delete-ns)
+ local _deletens
+ _deletens=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':namespace to delete'
+ -n':alias of --namespace-id'
+ --timeout=':value for timeout'
+ -t':alias of --timeout'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme delete-ns options" _deletens
+ ;;
+ (attach-ns)
+ local _attachns
+ _attachns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':namespace to attach to the controller'
+ -n':alias of --namespace-id'
+ --controllers=':if a device is not provided, supply a comma-sep list of controllers'
+ -c':alias of --controllers'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme attach-ns options" _attachns
+ ;;
+ (detach-ns)
+ local _detachns
+ _detachns=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':namespace to detach from controller'
+ -n':alias of --namespace-id'
+ --controllers=':if a device is not provided, supply a comma-sep list of controllers'
+ -c':alias of --controllers'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme detach-ns options" _detachns
+ ;;
+ (list-ctrl)
+ local _listctrl
+ _listctrl=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show controllers attached to this namespace'
+ -n':alias of --namespace-id'
+ --cntid=':start the list with this controller'
+ -c':alias of --cntid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme list-ctrl options" _listctrl
+ ;;
+ (get-ns-id)
+ local _getnsid
+ _getnsid=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme get-ns-id options" _getnsid
+ ;;
+ (get-log)
+ local _getlog
+ _getlog=(
+ /dev/nvme':supply a device to use (required)'
+ --log-id=':requested log number'
+ -i':alias of --log-id'
+ --log-len=':number of bytes to show for requested log'
+ -l':alias of --log-len'
+ --namespace-id=':get log specific to <nsid> if namespace logs are supported'
+ -n':alias of --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ --aen=':result of the aen, use to override log id'
+ -a':alias of --aen'
+ --lpo=':log page offset specifies the location within a log page from where to start returning data'
+ -L':alias of --lpo'
+ --lsi=':log specific identifier specifies an identifier that is required for a particular log page'
+ -S':alias of --lsi'
+ --rae':Retain an Asynchronous Event'
+ -r':alias of --rae'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ --csi=':command set identifier'
+ -y':alias of --csi'
+ --ot':offset type'
+ -O':alias of --ot'
+ --xfer-len=':read chunk size (default 4k)'
+ -x':alias of --xfer-len'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme get-log options" _getlog
+ ;;
+ (persistent-event-log)
+ local _persistenteventlog
+ _persistenteventlog=(
+ /dev/nvme':supply a device to use (required)'
+ --action=':action the controller shall take for this log page'
+ -a':alias to --action'
+ --log-len=':number of bytes to show for requested log'
+ -l':alias of --log-len'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme persistent-event-log options" _persistenteventlog
+ ;;
+ (telemetry-log)
+ local _telemetry_log
+ _telemetry_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-file=':telemetry data output write'
+ -O':alias for --output-file'
+ --host-generate=':Have the host tell the controller to generate the report'
+ -g':alias to --host-generate'
+ --controller-init':Gather report generated by the controller'
+ -c':alias of --controller-init'
+ --data-area':Pick which telemetry data area to report'
+ -d':alias of --data-area'
+ --data-area':Pick which telemetry data area to report'
+ -d':alias of --data-area'
+ --rae':Retain an Asynchronous Event'
+ -r':alias to --rae'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme telemetry-log options" _telemetry_log
+ ;;
+ (pred-lat-event-agg-log)
+ local _predlateventagglog
+ _predlateventagglog=(
+ /dev/nvme':supply a device to use (required)'
+ --log-entries=':Number of pending NVM Set Entries log list'
+ -e':alias to --log-entries'
+ --rae':Retain an Asynchronous Event'
+ -r':alias to --rae'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme pred-lat-event-agg-log options" _predlateventagglog
+ ;;
+ (predictable-lat-log)
+ local _predictablelatlog
+ _predictablelatlog=(
+ /dev/nvme':supply a device to use (required)'
+ --nvmset-id=':NVM Set Identifier on which log page retrieve info'
+ -i':alias to --nvmset-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme predictable-lat-log options" _predictablelatlog
+ ;;
+ (fw-log)
+ local _fwlog
+ _fwlog=(
+ /dev/nvme':supply a device to use (required)'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme fw-log options" _fwlog
+ ;;
+ (changed-ns-list-log)
+ local _changed_ns_list_log
+ _changed_ns_list_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme changed-ns-list-log options" _changed_ns_list_log
+ ;;
+ (smart-log)
+ local _smartlog
+ _smartlog=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':get SMART log specific to <nsid> if namespace logs are supported'
+ -n':alias to --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias to --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme smart-log options" _smartlog
+ ;;
+ (smart-log-add)
+ local _add
+ _add=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':get additional SMART log specific to <nsid> if namespace logs supported'
+ -n':alias to --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias to --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme smart-log-add options" _add
+ ;;
+ (ana-log)
+ local _ana_log
+ _ana_log=(
+ /dev/nvme':supply a device to use (required)'
+ --groups':Return ANA groups only'
+ -g':alias to --groups'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ana-log options" _ana_log
+ ;;
+ (error-log)
+ local _errlog
+ _errlog=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':get log specific to <nsid> if namespace logs are supported'
+ -n':alias to --namespace-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias to --raw-binary'
+ --log-entries=':request n >= 1 log entries'
+ -e':alias to --log-entries'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme error-log options" _errlog
+ ;;
+ (effects-log)
+ local _effects_log
+ _effects_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ --raw-binary':dump infos in binary format'
+ -b':alias to --raw-binary'
+ --csi=':command set identifier'
+ -c':alias of --csi'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme effects-log options" _effects_log
+ ;;
+ (endurance-log)
+ local _endurance_log
+ _endurance_log=(
+ /dev/nvme':supply a device to use (required)'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --group-id=':The endurance group identifier'
+ -g':alias of --group-id'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme endurance-log options" _endurance_log
+ ;;
+ (endurance-event-agg-log)
+ local _enduranceeventagglog
+ _enduranceeventagglog=(
+ /dev/nvme':supply a device to use (required)'
+ --log-entries=':Number of Endurance Group Event Agg Entries log list'
+ -e':alias to --log-entries'
+ --rae':Retain an Asynchronous Event'
+ -r':alias to --rae'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme endurance-event-agg-log options" _enduranceeventagglog
+ ;;
+ (lba-status-log)
+ local _lbastatuslog
+ _lbastatuslog=(
+ /dev/nvme':supply a device to use (required)'
+ --rae':Retain an Asynchronous Event'
+ -r':alias to --rae'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme lba-status-log options" _lbastatuslog
+ ;;
+ (resv-notif-log)
+ local _resvnotiflog
+ _resvnotiflog=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme resv-notif-log options" _resvnotiflog
+ ;;
+ (boot-part-log)
+ local _bootpartlog
+ _bootpartlog=(
+ /dev/nvme':supply a device to use (required)'
+ --lsp=':log specific field'
+ -s':alias to --lsp'
+ --output-file=':boot partition data output write'
+ -f':alias for --output-file'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme boot-part-log options" _bootpartlog
+ ;;
+ (get-feature)
+ local _getf
+ _getf=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':get feature specific to <nsid>'
+ -n':alias to --namespace-id'
+ --feature-id=':hexadecimal name of feature to examine (required)'
+ -f':alias to --feature-id'
+ --sel=':select from 0 - current, 1 - default, 2 - saved, 3 - supported'
+ -s':alias to --sel'
+ --data-len=':buffer len for returned LBA Type Range or host identifier data'
+ -l':alias for --data-len'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ --cdw11=':dword 11 value, used for interrupt vector configuration only'
+ --raw-binary':dump infos in binary format'
+ -b':alias to --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme get-feature options" _getf
+ ;;
+ (device-self-test)
+ local _device_self_test
+ _device_self_test=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':Indicate the namespace in which the device self-test has to be carried out'
+ -n':alias to --namespace-id'
+ --self-test-code=':This field specifies the action taken by the device self-test command'
+ -s':alias for --self-test-code'
+ --wait':Wait for the test to finish'
+ -w':alias to --wait'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme device-self-test options" _device_self_test
+ ;;
+ (self-test-log)
+ local _self_test_log
+ _self_test_log=(
+ /dev/nvme':supply a device to use (required)'
+ --dst-entries=':Indicate how many DST log entries to be retrieved'
+ -e':alias to --dst-entries'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --verbose':show infos verbosely'
+ -v':alias of --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme self-test-log options" _self_test_log
+ ;;
+ (lockdown)
+ local _lockdown
+ _lockdown=(
+ /dev/nvme':supply a device to use (required)'
+ --ofi=':Opcode or Feature Identifier(OFI) (required)'
+ -O':alias of --ofi'
+ --ifc=':Interface (INF) field Information (required)'
+ -f':alias of --ifc'
+ --prhbt=':Prohibit(PRHBT) bit field (required)'
+ -p':alias of --prhbt'
+ --scp=':Scope(SCP) field for identifying opcode or feature id (required)'
+ -s':alias of --scp'
+ --uuid=':UUID Index field required aligned with Scope'
+ -U':alias of --uuid'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme lockdown options" _lockdown
+ ;;
+ (set-feature)
+ local _setf
+ _setf=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':feature is specific to <nsid>'
+ -n':alias to --namespace-id'
+ --feature-id=':hexadecimal name of feature to set (required)'
+ -f':alias to --feature-id'
+ --data-len=':buffer length, only used for LBA Type Range or host identifier data'
+ -l':alias for --data-len'
+ --data=':data file for LBA Type Range or host identifier buffer (defaults to stdin)'
+ -d':alias to --data'
+ --value=':new value of feature (required)'
+ -V'alias to --value'
+ --uuid-index=':uuid index'
+ -U':alias for --uuid-index'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme set-feature options" _setf
+ ;;
+ (set-property)
+ local _set_property
+ _set_property=(
+ /dev/nvme':supply a device to use (required)'
+ --offset=':the offset of the property'
+ -O':alias to --offset'
+ --value=':the value of the property to be set'
+ -V':alias to --value'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme set-property options" _set_property
+ ;;
+ (get-property)
+ local _get_property
+ _get_property=(
+ /dev/nvme':supply a device to use (required)'
+ --offset=':the offset of the property'
+ -O':alias to --offset'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme get-property options" _get_property
+ ;;
+ (format)
+ local _format
+ _format=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':<nsid> of namespace to format (required)'
+ -n':alias of --namespace-id'
+ --timeout=':value for timeout'
+ -t':alias of --timeout'
+ --lbaf=':LBA format to apply to namespace (required)'
+ -l':alias of --lbaf'
+ --ses=':secure erase? 0 - no-op (default), 1 - user-data erase, 2 - cryptographic erase'
+ -s':alias of --ses'
+ --pil=':location of protection information? 0 - end, 1 - start'
+ -p':alias of --pil'
+ --pi=':protection information? 0 - off, 1 - Type 1 on, 2 - Type 2 on, 3 - Type 3 on'
+ -i':alias of --pi'
+ --ms=':extended format? 0 - off (metadata in separate buffer), 1 - on (extended LBA used)'
+ -m':alias of --ms'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme format options" _format
+ ;;
+ (fw-activate)
+ local _fwact
+ _fwact=(
+ /dev/nvme':supply a device to use (required)'
+ --action=':activation action (required)? 0 - replace fw without activating, 1 - replace with activation, 2 - replace with activation at next reset'
+ -a':alias of --action'
+ --slot=':firmware slot to activate'
+ -s':alias of --slot'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme fw-activate options" _fwact
+ ;;
+ (fw-download)
+ local _fwd
+ _fwd=(
+ /dev/nvme':supply a device to use (required)'
+ --fw=':firmware file to download (required)'
+ -f':alias of --fw'
+ --xfer=':limit on chunk-size of transfer (if device has download size limit)'
+ -x':alias of --xfer'
+ --offset=':starting offset, in dwords (defaults to 0, only useful if download is split across multiple files)'
+ -O':alias of --offset'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme fw-download options" _fwd
+ ;;
+ (capacity-mgmt)
+ local _fwd
+ _fwd=(
+ /dev/nvme':supply a device to use (required)'
+ --operation=':Operation to be performed by the controller'
+ -O':alias of --operation'
+ --element-id=':specific to the value of the Operation field'
+ -i':alias of --element-id'
+ --cap-lower=':Least significant 32 bits of the capacity in bytes'
+ -l':alias of --cap-lower'
+ --cap-upper=':Most significant 32 bits of the capacity in bytes'
+ -u':alias of --cap-upper'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme capacity-mgmt options" _fwd
+ ;;
+ (write-zeroes)
+ local _write_zeroes
+ _write_zeroes=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --start-block=':64-bit address of the first logical block to be written'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to write'
+ -c':alias of --block-count'
+ --dir-type=':directive type'
+ -T':alias of --dir-type'
+ --deac':Set DEAC bit, requesting controller to deallocate specified logical blocks'
+ -d':alias of --deac'
+ --limited-retry':if included, controller should try less hard to send data to media (if not included, all available data-recovery means used)'
+ -l':alias of --limited-retry'
+ --force-unit-access':data shall be written to nonvolatile media before command completion is indicated'
+ -f':alias of --force-unit-access'
+ --prinfo=':protection information and check field'
+ -p':alias of --prinfo'
+ --ref-tag=':reference tag (for end to end PI)'
+ -r':alias of --ref-tag'
+ --app-tag-mask=':application tag mask (for end to end PI)'
+ -m':alias of --app-tag-mask'
+ --app-tag=':application tag (for end to end PI)'
+ -a':alias of --app-tag'
+ --storage-tag=':storage tag for end-to-end PI'
+ -S':alias of --storage-tag'
+ --storage-tag-check':Storage Tag field shall be checked as part of end-to-end data protection processing'
+ -C':alias of --storage-tag-check'
+ --dir-spec=':directive specific'
+ -D':alias of --dir-spec'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme write-zeroes options" _write_zeroes
+ ;;
+ (write-uncor)
+ local _write_uncor
+ _write_uncor=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --start-block=':64-bit address of the first logical block to be written'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to write'
+ -c':alias of --block-count'
+ --dir-type=':directive type'
+ -T':alias of --dir-type'
+ --dir-spec':directive specific'
+ -S':alias of --dir-spec'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme write-uncor options" _write_uncor
+ ;;
+ (verify)
+ local _verify
+ _verify=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --start-block=':64-bit address of the first logical block to be verified'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to verify'
+ -c':alias of --block-count'
+ --limited-retry':if included, controller should try less hard to send data to media (if not included, all available data-recovery means used)'
+ -l':alias of --limited-retry'
+ --force-unit-access':data shall be verified from nonvolatile media before command completion is indicated'
+ -f':alias of --force-unit-access'
+ --prinfo=':protection information and check field'
+ -p':alias of --prinfo'
+ --ref-tag=':reference tag (for end to end PI)'
+ -r':alias of --ref-tag'
+ --app-tag=':application tag (for end to end PI)'
+ -a':alias of --app-tag'
+ --app-tag-mask=':application tag mask (for end to end PI)'
+ -m':alias of --app-tag-mask'
+ --storage-tag=':storage tag for end-to-end PI'
+ -S':alias of --storage-tag'
+ --storage-tag-check':Storage Tag field shall be checked as part of end-to-end data protection processing'
+ -C':alias of --storage-tag-check'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme verify options" _verify
+ ;;
+ (sanitize)
+ local _sanitize
+ _sanitize=(
+ /dev/nvme':supply a device to use (required)'
+ --no-dealloc':No deallocate after sanitize'
+ -d':alias of --no-dealloc'
+ --oipbp':Overwrite invert pattern between passes'
+ -i':alias of --oipbp'
+ --owpass=':Overwrite pass count'
+ -n':alias of --owpass'
+ --ause':Allow unrestricted sanitize exit'
+ -u':alias of --ause'
+ --sanact=':Sanitize action: 1 = Exit failure mode, 2 = Start block erase, 3 = Start overwrite, 4 = Start crypto erase'
+ -a':alias of --sanact'
+ --ovrpat=':Overwrite pattern'
+ -p':alias of --ovrpat'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme sanitize options" _sanitize
+ ;;
+ (sanitize-log)
+ local _sanitize_log
+ _sanitize_log=(
+ /dev/nvme':supply a device to use (required)'
+ --rae':Retain an Asynchronous Event'
+ -r':alias of --rae'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme sanitize-log options" _sanitize_log
+ ;;
+ (reset)
+ local _reset
+ _reset=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme reset options" _reset
+ ;;
+ (subsystem-reset)
+ local _subsystem_reset
+ _subsystem_reset=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme subsystem-reset options" _subsystem_reset
+ ;;
+ (ns-rescan)
+ local _ns_rescan
+ _ns_rescan=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ns-rescan options" _ns_rescan
+ ;;
+ (supported-log-pages)
+ local _support
+ _support=(
+ /dev/nvme':supply a device to use (required)'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme supported-log-pages options" _support
+ ;;
+ (media-unit-stat-log)
+ local _medialog
+ _medialog=(
+ /dev/nvme':supply a device to use (required)'
+ --dom-id=':show infos for domain id'
+ -d':alias of --dom-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme media-unit-stat-log" _medialog
+ ;;
+ (supported-cap-config-log)
+ local _caplog
+ _caplog=(
+ /dev/nvme':supply a device to use (required)'
+ --dom-id=':show infos for domain id'
+ -d':alias of --dom-id'
+ --raw-binary':dump infos in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme supported-cap-config-log" _caplog
+ ;;
+ (admin-passthru)
+ local _admin
+ _admin=(
+ /dev/nvme':supply a device to use (required)'
+ --opcode=':hexadecimal opcode to send (required)'
+ -O':alias of --opcode'
+ --flags=':command flags'
+ -f':alias of --flags'
+ --rsvd=':value for reserved field'
+ -R':alias of --rsvd'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --data-len=':length for data buffer'
+ -l':alias of --data-len'
+ --metadata-len=':length for metadata buffer'
+ -m':alias of --metadata-len'
+ --timeout=':value for timeout'
+ -t':alias of --timeout'
+ --cdw2=':value for command dword 2'
+ -2':alias for --cdw2'
+ --cdw3=':value for command dword 3'
+ -3':alias for --cdw3'
+ --cdw10=':value for command dword 10'
+ -4':alias for --cdw10'
+ --cdw11=':value for command dword 11'
+ -5':alias for --cdw11'
+ --cdw12=':value for command dword 12'
+ -6':alias for --cdw12'
+ --cdw13=':value for command dword 13'
+ -7':alias for --cdw13'
+ --cdw14=':value for command dword 14'
+ -8':alias for command dword 14'
+ --cdw15=':value for command dword 15'
+ -9':alias for command dword 15'
+ --input-file=':defaults to stdin; input for write (send direction)'
+ -i':alias for --input-file'
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ --show-command':simply print command instead of sending it to <device>'
+ -s':alias for --show-command'
+ --dry-run':alias for --show-command'
+ -d':alias for --show-command'
+ --read':set dataflow direction to receive'
+ -r':alias for --read'
+ --write':set dataflow direction to send'
+ -w':alias for --write'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme admin-passthru options" _admin
+ ;;
+ (io-passthru)
+ local _io
+ _io=(
+ /dev/nvme':supply a device to use (required)'
+ --opcode=':hexadecimal opcode to send (required)'
+ -O':alias of --opcode'
+ --flags=':command flags'
+ -f':alias of --flags'
+ --rsvd=':value for reserved field'
+ -R':alias of --rsvd'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --data-len=':length for data buffer'
+ -l':alias of --data-len'
+ --metadata-len=':length for metadata buffer'
+ -m':alias of --metadata-len'
+ --timeout=':value for timeout'
+ -t':alias of --timeout'
+ --cdw2=':value for command dword 2'
+ -2':alias for --cdw2'
+ --cdw3=':value for command dword 3'
+ -3':alias for --cdw3'
+ --cdw10=':value for command dword 10'
+ -4':alias for --cdw10'
+ --cdw11=':value for command dword 11'
+ -5':alias for --cdw11'
+ --cdw12=':value for command dword 12'
+ -6':alias for --cdw12'
+ --cdw13=':value for command dword 13'
+ -7':alias for --cdw13'
+ --cdw14=':value for command dword 14'
+ -8':alias for command dword 14'
+ --cdw15=':value for command dword 15'
+ -9':alias for command dword 15'
+ --input-file=':defaults to stdin; input for write (send direction)'
+ -i':alias for --input-file'
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ --show-command':simply print command instead of sending it to <device>'
+ -s':alias for --show-command'
+ --dry-run':alias for --show-command'
+ -d':alias for --show-command'
+ --read':set dataflow direction to receive'
+ -r':alias for --read'
+ --write':set dataflow direction to send'
+ -w':alias for --write'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme io-passthru options" _io
+ ;;
+ (security-send)
+ local _ssend
+ _ssend=(
+ /dev/nvme':supply a device to use (required)'
+ --file=':payload'
+ -f':alias for --file'
+ --secp=':security protocol as defined in SPC-4'
+ -p':alias for --secp'
+ --spsp=':send security-protocol-specific data as defined in SPC-4'
+ -s':alias for --spsp'
+ --tl=':transfer length as defined in SPC-4'
+ -t':alias for --tl'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme security-send options" _ssend
+ ;;
+ (security-recv)
+ local _srecv
+ _srecv=(
+ /dev/nvme':supply a device to use (required)'
+ --secp=':security protocol as defined in SPC-4'
+ -p':alias for --secp'
+ --spsp=':send security-protocol-specific data as defined in SPC-4'
+ -s':alias for --spsp'
+ --size=':size of buffer (prints to stdout on successful recv)'
+ -x':alias for --size'
+ --al=':allocation length as defined in SPC-4'
+ -a':alias for --al'
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme security-recv options" _srecv
+ ;;
+ (get-lba-status)
+ local _get_lba_status
+ _get_lba_status=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':show infos for namespace <nsid>'
+ -n':alias of --namespace-id'
+ --start-lba=':Starting LBA(SLBA) in 64-bit address of the first logical block'
+ -s':alias for --start-lba'
+ --max-dw=':Maximum Number of Dwords(MNDW) specifies maximum number of dwords to return'
+ -m':alias for --max-dw'
+ --action=':Action Type(ATYPE) specifies the mechanism'
+ -a':alias for --action'
+ --range-len=':Range Length(RL) specifies the length of the range of contiguous LBAs beginning at SLBA'
+ -l':alias for --range-len'
+ --timeout':value for timeout'
+ -t':alias for --timeout'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme get-lba-status options" _get_lba_status
+ ;;
+ (resv-acquire)
+ local _acq
+ _acq=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':<nsid> of namespace to try to reserve (required)'
+ -n':alias for --namespace-id'
+ --prkey=':pre-empt reservation key'
+ -p':alias for --prkey'
+ --rtype=':hexadecimal reservation type'
+ -t':alias for --rtype'
+ --racqa=':reservation acquire action'
+ -a':alias for --racqa'
+ --iekey=':ignore existing reservation key'
+ -i':alias for --iekey'
+ --crkey':current reservation key'
+ -c':alias for --crkey'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme resv-acquire options" _acq
+ ;;
+ (resv-release)
+ local _rel
+ _rel=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':nsid'
+ -n':alias of --namespace-id'
+ --rtype=':hexadecimal reservation type'
+ -t':alias of --rtype'
+ --rrela=':reservation release action'
+ -a':alias of --rrela'
+ --iekey':ignore existing reservation key'
+ -i':alias of --iekey'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme resv-release options" _rel
+ ;;
+ (resv-report)
+ local _rep
+ _rep=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':nsid'
+ -n':alias of --namespace-id'
+ --numd=':number of dwords of reservation status to xfer'
+ -d':alias of --numd'
+ --eds':request extended data structure'
+ -e':alias of --eds'
+ --raw-binary':dump output in binary format'
+ -b':alias of --raw-binary'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme resv-report options" _rep
+ ;;
+ (resv-register)
+ local _reg
+ _reg=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':nsid'
+ -n':alias of --namespace-id'
+ --crkey=':current reservation key'
+ -c'alias of --crkey'
+ --nrkey=':new reservation key'
+ -k':alias of --nrkey'
+ --cptpl=':change persistence through power loss setting'
+ -p':alias for --cptpl'
+ --rrega=':reservation registration action to perform'
+ -r':alias for --rrega'
+ --iekey':ignore existing reservation key'
+ -i':alias for --iekey'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme resv-register options" _reg
+ ;;
+ (dsm)
+ local _dsm
+ _dsm=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --ctx-attrs=':Comma separated list of the context attributes in each range'
+ -a':alias of --ctx-attrs'
+ --blocks':Comma separated list of the number of blocks in each range'
+ -b':alias of --blocks'
+ --slbs':Comma separated list of the starting block in each range'
+ -s':alias of --slbs'
+ --ad':Attribute Deallocate'
+ -d':alias of --ad'
+ --idw':Attribute Integral Dataset for Write'
+ -w':alias of --idw'
+ --idr':Attribute Integral Dataset for Read'
+ -r':alias of --idr'
+ --cdw11=':value for command dword 11'
+ -c':alias for --cdw11'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme dsm options" _dsm
+ ;;
+ (copy)
+ local _copy
+ _copy=(
+ /dev/nvme':supply a device to use (required)'
+ --sdlba=':64-bit addr of first destination logical block'
+ -d':alias of --sdlba'
+ --slbs=':64-bit addr of first block per range (comma-separated list)'
+ -s':alias of --slbs'
+ --blocks=':number of blocks per range (comma-separated list, zeroes-based values)'
+ -b':alias of --blocks'
+ --limited-retry':if included, controller should try less hard to retrieve data from media (if not included, all available data recovery means used)'
+ -l':alias of --limited-retry'
+ --force-unit-access':if included, the data shall be read from non-volatile media'
+ -f':alias of --force-unit access'
+ --prinfow=':protection information and check field (write part)'
+ -p':alias of --prinfow'
+ --prinfor=':protection information and check field (read part)'
+ -P':alias of --prinfor'
+ --ref-tag=':initial lba reference tag (write part)'
+ -r':alias of --ref-tag'
+ --expected-ref-tags=':expected lba reference tags (read part, comma-separated list)'
+ -R':alias of --expected-ref-tags'
+ --app-tag=':lba application tag (write part)'
+ -a':alias of --app-tag'
+ --expected-app-tags=':expected lba application tags (read part, comma-separated list)'
+ -A':alias of --expected-app-tags'
+ --app-tag-mask=':lba application tag mask (write part)'
+ -m':alias of --app-tag-mask'
+ --expected-app-tag-masks=':expected lba application tag masks (read part, comma-separated list)'
+ -M':alias of --expected-app-tag-masks'
+ --dir-type=':directive type (write part)'
+ -T':alias of --dir-type'
+ --dir-spec=':directive specific (write part)'
+ -S':alias of --dir-spec'
+ --format=':source range entry format'
+ -F':alias of --format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme copy options" _copy
+ ;;
+ (flush)
+ local _flush
+ _flush=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':nsid'
+ -n':alias of --namespace-id'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme flush options" _flush
+ ;;
+ (compare)
+ local _comp
+ _comp=(
+ /dev/nvme':supply a device to use (required)'
+ --start-block=':begin compare at this 64-bit LBA on device'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to compare to local data'
+ -c':alias of --block-count'
+ --metadata-size=':number of bytes of metadata to compare'
+ -y':alias of --metadata-size'
+ --data-size=':size of local data buffer in bytes'
+ -z':alias of --data-size'
+ --data=':local data file to compare to blocks on device'
+ -d':alias of --data'
+ --prinfo=':protection information action and check field'
+ -p':alias of --prinfo'
+ --app-tag-mask=':application tag mask (for end to end PI)'
+ -m':alias of --app-tag-mask'
+ --app-tag=':application tag (for end to end PI)'
+ -a':alias of --app-tag'
+ --limited-retry':if included, controller should try less hard to retrieve data from media (if not included, all available data recovery means used)'
+ -l':alias of --limited-retry'
+ --force-unit-access':if included, the data shall be read from non-volatile media'
+ -f':alias of --force-unit access'
+ --show-command':show command instead of sending to device'
+ -V':alias of --show-command'
+ --dry-run':show command instead of sending to device'
+ -w':alias of --show-command'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme compare options" _comp
+ ;;
+ (read)
+ local _read
+ _read=(
+ /dev/nvme':supply a device to use (required)'
+ --start-block=':64-bit address of the first logical block to be read'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to read'
+ -c':alias of --block-count'
+ --data-size=':size of data to be read'
+ -z':alias of --data-size'
+ --metadata-size=':size of metadata to be read'
+ -y':alias of --metadata-size'
+ --ref-tag=':reference tag (for end to end PI)'
+ -r':alias of --ref-tag'
+ --data=':file into which data should be read (defaults to stdout)'
+ -d':alias of --data'
+ --prinfo=':protection information and check field'
+ -p':alias of --prinfo'
+ --app-tag-mask=':application tag mask (for end to end PI)'
+ -m':alias of --app-tag-mask'
+ --app-tag=':application tag (for end to end PI)'
+ -a':alias of --app-tag'
+ --limited-retry':if included, controller should try less hard to retrieve data from media (if not included, all available data-recovery means used)'
+ -l':alias of --limited-retry'
+ --latency':latency statistics will be output following read'
+ -t':alias of --latency'
+ --force-unit-access':data read shall be returned from nonvolatile media before command completion is indicated'
+ -f':alias of --force-unit-access'
+ --show-command':show command instead of sending to device'
+ -V':alias of --show-command'
+ --dry-run':show command instead of sending to device'
+ -w':alias of --show-command'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme read options" _read
+ ;;
+ (write)
+ local _wr
+ _wr=(
+ /dev/nvme':supply a device to use (required)'
+ --start-block=':64-bit address of the first logical block to be written'
+ -s':alias of --start-block'
+ --block-count=':number of logical blocks on device to write'
+ -c':alias of --block-count'
+ --data-size=':size of data to be written'
+ -z':alias of --data-size'
+ --metadata-size=':size of metadata to be written'
+ -y':alias of --metadata-size'
+ --ref-tag=':reference tag (for end to end PI)'
+ -r':alias of --ref-tag'
+ --data=':file from which data should be written to device (defaults to stdin)'
+ -d':alias of --data'
+ --prinfo=':protection information and check field'
+ -p':alias of --prinfo'
+ --app-tag-mask=':application tag mask (for end to end PI)'
+ -m':alias of --app-tag-mask'
+ --app-tag=':application tag (for end to end PI)'
+ -a':alias of --app-tag'
+ --limited-retry':if included, controller should try less hard to send data to media (if not included, all available data-recovery means used)'
+ -l':alias of --limited-retry'
+ --latency':latency statistics will be output following write'
+ -t':alias of --latency'
+ --force-unit-access':data shall be written to nonvolatile media before command completion is indicated'
+ -f':alias of --force-unit-access'
+ --show-command':show command instead of sending to device'
+ -V':alias of --show-command'
+ --dry-run':show command instead of sending to device'
+ -w':alias of --show-command'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme write options" _wr
+ ;;
+ (show-regs)
+ local _shor
+ _shor=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme show-regs options" _shor
+ ;;
+ (fid-support-effects-log)
+ local _fidsupporteffectslog
+ _fidsupporteffectslog=(
+ /dev/nvme':supply a device to use (required)'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme fid-support-effects-log options" _fidsupporteffectslog
+ ;;
+ (discover)
+ local _discover
+ _discover=(
+ --device=':use existing discovery controller device'
+ -d':alias for --device'
+ --transport=':transport type'
+ -t':alias for --transport'
+ --nqn=':subsystem nqn'
+ -n':alias for --nqn'
+ --traddr=':transport address'
+ -a':alias for --traddr'
+ --trsvcid=':transport service id (e.g. IP port)'
+ -s':alias for --trsvcid'
+ --host-traddr=':host traddr (e.g. FC WWN's)'
+ -w':alias for --host-traddr'
+ --host-iface=':host interface (for tcp transport)'
+ -f':alias for --host-iface'
+ --hostnqn=':user-defined hostnqn'
+ -q':alias for --hostnqn'
+ --hostid=':user-defined hostid (if default not used)'
+ -I':alias for --hostid'
+ --dhchap-secret=':user-defined dhchap key (if default not used)'
+ -S':alias for --dhchap-secret'
+ --nr-io-queues=':number of io queues to use (default is core count)'
+ -i':alias for --nr-io-queues'
+ --nr-write-queues=':number of write queues to use (default 0)'
+ -W':alias for --nr-write-queues'
+ --nr-poll-queues=':number of poll queues to use (default 0)'
+ -P':alias for --nr-poll-queues'
+ --queue-size=':number of io queue elements to use (default 128)'
+ -Q':alias for --queue-size'
+ --keep-alive-tmo=':keep alive timeout period in seconds'
+ -k':alias for --keep-alive-tmo'
+ --reconnect-delay=':reconnect timeout period in seconds'
+ -c':alias for --reconnect-delay'
+ --ctrl-loss-tmo=':controller loss timeout period in seconds'
+ -l':alias for --ctrl-loss-tmo'
+ --tos=':type of service'
+ -T':alias for --tos'
+ --keyring=':Keyring for TLS key lookup'
+ --tls_key=':TLS key to use'
+ --duplicate-connect':allow duplicate connections between same transport host and subsystem port'
+ -D':alias for --duplicate-connect'
+ --disable-sqflow':disable controller sq flow control (default false)'
+ -d':alias for --disable-sqflow'
+ --hdr-digest':enable transport protocol header digest (TCP transport)'
+ -g':alias for --hdr-digest'
+ --data-digest':enable transport protocol data digest (TCP transport)'
+ -G':alias for --data-digest'
+ --tls':enable TLS'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --raw':save raw output to file'
+ -r':alias of --raw'
+ --persistent':'
+ -p':alias for --'
+ --quiet':'
+ -S':alias for --'
+ --config=':Use specified JSON configuration file or none to disable'
+ -J':alias for --config'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ --dump-config':Dump configuration file to stdout'
+ -O':alias for --dump-config'
+ --force':Force persistent discovery controller creation'
+ --nbft':Only look at NBFT tables'
+ --no-nbft':Do not look at NBFT tables'
+ --nbft-patch=':user-defined path for NBFT tables'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme discover options" _discover
+ ;;
+ (connect-all)
+ local _connect_all
+ _connect_all=(
+ --device=':use existing discovery controller device'
+ -d':alias for --device'
+ --transport=':transport type'
+ -t':alias for --transport'
+ --nqn=':subsystem nqn'
+ -n':alias for --nqn'
+ --traddr=':transport address'
+ -a':alias for --traddr'
+ --trsvcid=':transport service id (e.g. IP port)'
+ -s':alias for --trsvcid'
+ --host-traddr=':host traddr (e.g. FC WWN's)'
+ -w':alias for --host-traddr'
+ --host-iface=':host interface (for tcp transport)'
+ -f':alias for --host-iface'
+ --hostnqn=':user-defined hostnqn'
+ -q':alias for --hostnqn'
+ --hostid=':user-defined hostid (if default not used)'
+ -I':alias for --hostid'
+ --dhchap-secret=':user-defined dhchap key (if default not used)'
+ -S':alias for --dhchap-secret'
+ --nr-io-queues=':number of io queues to use (default is core count)'
+ -i':alias for --nr-io-queues'
+ --nr-write-queues=':number of write queues to use (default 0)'
+ -W':alias for --nr-write-queues'
+ --nr-poll-queues=':number of poll queues to use (default 0)'
+ -P':alias for --nr-poll-queues'
+ --queue-size=':number of io queue elements to use (default 128)'
+ -Q':alias for --queue-size'
+ --keep-alive-tmo=':keep alive timeout period in seconds'
+ -k':alias for --keep-alive-tmo'
+ --reconnect-delay=':reconnect timeout period in seconds'
+ -c':alias for --reconnect-delay'
+ --ctrl-loss-tmo=':controller loss timeout period in seconds'
+ -l':alias for --ctrl-loss-tmo'
+ --tos=':type of service'
+ -T':alias for --tos'
+ --keyring=':Keyring for TLS key lookup'
+ --tls_key=':TLS key to use'
+ --duplicate-connect':allow duplicate connections between same transport host and subsystem port'
+ -D':alias for --duplicate-connect'
+ --disable-sqflow':disable controller sq flow control (default false)'
+ -d':alias for --disable-sqflow'
+ --hdr-digest':enable transport protocol header digest (TCP transport)'
+ -g':alias for --hdr-digest'
+ --data-digest':enable transport protocol data digest (TCP transport)'
+ -G':alias for --data-digest'
+ --tls':enable TLS'
+ --output-format=':Output format: normal|json|binary'
+ -o':alias for --output-format'
+ --raw':save raw output to file'
+ -r':alias of --raw'
+ --persistent':'
+ -p':alias for --'
+ --quiet':'
+ -S':alias for --'
+ --config=':Use specified JSON configuration file or none to disable'
+ -J':alias for --config'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ --dump-config':Dump configuration file to stdout'
+ -O':alias for --dump-config'
+ --force':Force persistent discovery controller creation'
+ --nbft':Only look at NBFT tables'
+ --no-nbft':Do not look at NBFT tables'
+ --nbft-patch=':user-defined path for NBFT tables'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme connect-all options" _connect_all
+ ;;
+ (connect)
+ local _connect
+ _connect=(
+ --transport=':transport type'
+ -t':alias for --transport'
+ --nqn=':subsystem nqn'
+ -n':alias for --nqn'
+ --traddr=':transport address'
+ -a':alias for --traddr'
+ --trsvcid=':transport service id (e.g. IP port)'
+ -s':alias for --trsvcid'
+ --host-traddr=':host transport address'
+ -w':alias for --host-traddr'
+ --host-iface=':host interface (for tcp transport)'
+ -f':alias for --host-iface'
+ --hostnqn=':user-defined hostnqn'
+ -q':alias for --hostnqn'
+ --hostid=':user-defined hostid (if default not used)'
+ -I':alias for --hostid'
+ --dhchap-secret=':user-defined dhchap key (if default not used)'
+ -S':alias for --dhchap-secret'
+ --nr-io-queues=':number of io queues to use (default is core count)'
+ -i':alias for --nr-io-queues'
+ --nr-write-queues=':number of write queues to use (default 0)'
+ -W':alias for --nr-write-queues'
+ --nr-poll-queues=':number of poll queues to use (default 0)'
+ -P':alias for --nr-poll-queues'
+ --queue-size=':number of io queue elements to use (default 128)'
+ -Q':alias for --queue-size'
+ --keep-alive-tmo=':keep alive timeout period in seconds'
+ -k':alias for --keep-alive-tmo'
+ --reconnect-delay=':reconnect timeout period in seconds'
+ -c':alias for --reconnect-delay'
+ --ctrl-loss-tmo=':controller loss timeout period in seconds'
+ -l':alias for --ctrl-loss-tmo'
+ --tos=':type of service'
+ -T':alias for --tos'
+ --keyring=':Keyring for TLS key lookup'
+ --tls_key=':TLS key to use'
+ --duplicate-connect':allow duplicate connections between same transport host and subsystem port'
+ -D':alias for --duplicate-connect'
+ --disable-sqflow':disable controller sq flow control (default false)'
+ -d':alias for --disable-sqflow'
+ --hdr-digest':enable transport protocol header digest (TCP transport)'
+ -g':alias for --hdr-digest'
+ --data-digest':enable transport protocol data digest (TCP transport)'
+ -G':alias for --data-digest'
+ --tls':enable TLS'
+ --dhchap-ctrl-secret=':user-defined dhchap controller key (for bi-directional authentication)'
+ -C':alias for --dhchap-ctrl-secret'
+ --config=':Use specified JSON configuration file or none to disable'
+ -J':alias for --config'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ --dump-config':Dump configuration file to stdout'
+ -O':alias for --dump-config'
+ --output-format=':Output format: normal|json'
+ -o':alias for --output-format'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme connect options" _connect
+ ;;
+ (dim)
+ local _dim
+ _dim=(
+ --nqn=':Comma-separated list of DC nqn'
+ -n':alias for --nqn'
+ --device=':Comma-separated list of DC nvme device handle'
+ -d':alias for --device'
+ --task=':The task to perform: register|deregister'
+ -t':alias for --task'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme dim options" _dim
+ ;;
+ (disconnect)
+ local _disconnect
+ _disconnect=(
+ --nqn=':subsystem nqn'
+ -n':alias for --nqn'
+ --device=':nvme device handle'
+ -d':alias for --device'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme disconnect options" _disconnect
+ ;;
+ (disconnect-all)
+ local _disconnect_all
+ _disconnect_all=(
+ --transport=':transport type'
+ -r':alias for --transport'
+ --verbose':Increase logging verbosity'
+ -v':alias for --verbose'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme disconnect-all options" _disconnect_all
+ ;;
+ (gen-hostnqn)
+ local _gen_hostnqn
+ _gen_hostnqn=(
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme gen-hostnqn options" _gen_hostnqn
+ ;;
+ (show-hostnqn)
+ local _show_hostnqn
+ _show_hostnqn=(
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme show-hostnqn options" _show_hostnqn
+ ;;
+ (dir-receive)
+ local _dir_receive
+ _dir_receive=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --data-len=':length for data buffer'
+ -l':alias of --data-len'
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ --dir-type=':directive type'
+ -D':alias of --dir-type'
+ --dir-spec=':directive specific'
+ -S':alias of --dir-spec'
+ --dir-oper=':directive operation'
+ -O':alias of --dir-oper'
+ --req-resource=':namespace stream requested'
+ -r':alias of --req-resource'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme dir-receive options" _dir_receive
+ ;;
+ (dir-send)
+ local _dir_send
+ _dir_send=(
+ /dev/nvme':supply a device to use (required)'
+ --namespace-id=':value for nsid'
+ -n':alias of --namespace-id'
+ --data-len=':length for data buffer'
+ -l':alias of --data-len'
+ --dir-type=':directive type'
+ -D':alias of --dir-type'
+ --target-dir=':target directive type to be enabled/disabled'
+ -T':alias of --target-dir'
+ --dir-spec=':directive specific'
+ -S':alias of --dir-spec'
+ --dir-oper=':directive operation'
+ -O':alias of --dir-oper'
+ --endir=':directive enable'
+ -e':alias of --endir'
+ --human-readable':show infos in readable format'
+ -H':alias of --human-readable'
+ --raw-binary':dump output in binary format'
+ -b':alias for --raw-binary'
+ --input-file=':write/send file (default stdin)'
+ -i':alias of --input-file'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme dir-send options" _dir_send
+ ;;
+ (virt-mgmt)
+ local _virt_mgmt
+ _virt_mgmt=(
+ /dev/nvme':supply a device to use (required)'
+ --cntlid=':Controller Identifier(CNTLID)'
+ -c':alias of --cntlid'
+ --rt=':Resource Type(RT): 0|1'
+ -r':alias of --rt'
+ --act=':Action(ACT): 1|7|8|9'
+ -a':alias of --act'
+ --nr=':Number of Controller Resources(NR)'
+ -n':alias of --nr'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme virt-mgmt options" _virt_mgmt
+ ;;
+ (rpmb)
+ local _rpmb
+ _rpmb=(
+ /dev/nvme':supply a device to use (required)'
+ --cmd=':RPMB action: info|program-key|read-counter|write-data|read-data|write-config|read-config'
+ -c':alias of --cmd'
+ --msgfile=':data file for read/write-data, read/write-config options'
+ -f':alias of --msgfile'
+ --keyfile=':key file that has authentication key to be used'
+ -g':alias of --keyfile'
+ --key=':key to be used for authentication'
+ -k':alias of --key'
+ --msg=':data to be written on write-data or write-config commands'
+ -d':alias of --msg'
+ --address=':Sector offset to read from or write to for an RPMB target, default 0'
+ -o':alias of --address'
+ --blocks=':Number of 512 blocks to read or write'
+ -b':alias of --blocks'
+ --target=':RPMB target - numerical value of 0 to 6, default 0'
+ -t':alias of --target'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme rpmb options" _rpmb
+ ;;
+ (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
+ ;;
+ (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=(
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme version options" _version
+ ;;
+ (ocp)
+ local _ocp
+ _ocp=(
+ smart-add-log':Retrieve extended SMART Information'
+ latency-monitor-log':Get Latency Monitor Log Page'
+ set-latency-monitor-feature':Set Latency Monitor feature'
+ internal-log':Retrieve and save internal device telemetry log'
+ clear-fw-activate-history':Clear firmware update history log"'
+ eol-plp-failure-mode':Define EOL or PLP circuitry failure mode'
+ clear-pcie-correctable-error-counters':Clear PCIe correctable error counters'
+ vs-fw-activate-history':Get firmware activation history log'
+ device-capability-log':Get Device capability log'
+ set-dssd-power-state-feature':Set DSSD Power State'
+ telemetry-string-log':Retrieve Telemetry string Log Page'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme ocp options" _ocp
+ ;;
+ (solidigm)
+ local _solidigm
+ _solidigm=(
+ id-ctrl':Send NVMe Identify Controller'
+ smart-log-add':Retrieve Solidigm SMART Log'
+ vs-smart-add-log':Get SMART / health extended log (redirects to ocp plug-in)'
+ vs-internal-log':Retrieve Debug log binaries'
+ garbage-collect-log':Retrieve Garbage Collection Log'
+ market-log':Retrieve Market Log'
+ latency-tracking-log':Enable/Retrieve Latency tracking Log'
+ parse-telemetry-log':Parse Telemetry Log binary'
+ clear-pcie-correctable-errors':Clear PCIe Correctable Error Counters (redirects to ocp plug-in)'
+ clear-fw-activate-history':Clear firmware update history log (redirects to ocp plug-in)'
+ vs-fw-activate-history':Get firmware activation history log (redirects to ocp plug-in)'
+ log-page-directory':Retrieve log page directory'
+ temp-stats':Retrieve Temperature Statistics log'
+ vs-drive-info':Retrieve drive information'
+ cloud-SSDplugin-version':Prints plug-in OCP version'
+ version':Shows the program version'
+ help':Display this help'
+ )
+ _arguments '*:: :->subcmds'
+ _describe -t commands "nvme solidigm options" _solidigm
+ ;;
+ (help)
+ local _h
+ _h=( id-ctrl id-ns list-ns id-iocs create-ns delete-ns attach-ns detach-ns
+ list-ctrl get-ns-id get-log fw-log smart-log error-log get-feature
+ set-feature format fw-activate fw-download admin-passthru io-passthru
+ security-send security-recv resv-acquire resv-register resv-release
+ resv-report flush compare read write copy show-regs persistent-event-log
+ 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 show-topology
+ list list-subsys id-ns-granularity primary-ctrl-caps list-secondary ns-descs
+ id-nvmset id-uuid list-endgrp telemetry-log changed-ns-list-log ana-log
+ 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
+ )
+ _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
+ ;;
+ (*)
+ _files
+ ;;
+ esac
+ return
+ fi
+
+ _files
+}
diff --git a/completions/bash-nvme-completion.sh b/completions/bash-nvme-completion.sh
new file mode 100644
index 0000000..d862aab
--- /dev/null
+++ b/completions/bash-nvme-completion.sh
@@ -0,0 +1,1604 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# bash tab completion for the nvme command line utility
+# (unfortunately, bash won't let me add descriptions to cmds)
+# Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015
+
+nvme_list_opts () {
+ local opts=""
+ local compargs=""
+ local vals=""
+ local opt=""
+ local val=""
+
+ 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 2 ]; then
+ opts="/dev/nvme* "
+ fi
+
+ opts+=" "
+ vals+=" "
+
+ if [[ $cur != -* ]] && [[ $cur != "" ]] && [[ $prev == "=" ]] && [[ ${words[$cword-2]} == --* ]]; then
+ opt+="${words[$cword-2]}"
+ val+="$cur"
+ elif [[ $cur == "" ]] && [[ $prev != "=" ]] || [[ $cur == "=" ]] && [[ $prev == --* ]]; then
+ opt+="$prev"
+ elif [[ $cur != "=" ]] && [[ $prev != --* ]] && [[ $prev != "=" ]]; then
+ opt+="$prev"
+ val+="$cur"
+ else
+ opt+="$cur"
+ fi
+
+ # Listed here in the same order as in nvme-builtin.h
+ case "$1" in
+ "list")
+ opts+=$NO_OPTS
+ ;;
+ "list-subsys")
+ opts=+=" --output-format= -o --verbose -v"
+ ;;
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -V --output-format= -o"
+ ;;
+ "id-ns")
+ opts+=" --namespace-id= -n --raw-binary -b \
+ --human-readable -H --vendor-specific -V \
+ --force -f --output-format= -o"
+ ;;
+ "id-ns-granularity")
+ opts+=" --output-format= -o"
+ ;;
+ "id-ns-lba-format")
+ opts+=" --lba-format-index= -i --uuid-index= -U \
+ --verbose -v --output-format= -o"
+ ;;
+ "list-ns")
+ opts+=" --namespace-id= -n --al -a --csi= -y \
+ --outputformat= -o"
+ ;;
+ "list-ctrl")
+ opts+=" --namespace-id= -n --cntid= -c \
+ --output-format= -o"
+ ;;
+ "cmdset-ind-id-ns")
+ opts+=" --namespace-id= -n --raw-binary -b \
+ --human-readable -H --output-format= -o"
+ ;;
+ "nvm-id-ctrl")
+ opts+=" --output-format= -o"
+ ;;
+ "nvm-id-ns")
+ opts+=" --namespace-id= -n --uuid-index= -U\
+ --verbose -v --output-format= -o"
+ ;;
+ "nvm-id-ns-lba-format")
+ opts+=" --lba-format-index= -i --uuid-index= -U \
+ --verbose -v --output-format= -o"
+ ;;
+ "primary-ctrl-caps")
+ opts+=" --output-format= -o --human-readable -H"
+ ;;
+ "list-secondary")
+ opts+=" --cntid= -c --namespace-id= n --num-entries -e \
+ --output-format= -o"
+ ;;
+ "ns-descs")
+ opts+=" --namespace-id= -n --output-format -o --raw-binary -b"
+ ;;
+ "id-nvmset")
+ opts+=" --nvmeset-id= -i --output-format= -o"
+ ;;
+ "id-uuid")
+ opts+=" --output-format= -o --raw-binary -b --human-readable -H"
+ ;;
+ "list-endgrp")
+ opts+=" --endgrp-id= -i --output-format= -o"
+ ;;
+ "id-iocs")
+ opts+=" --controller-id= -c"
+ ;;
+ "id-domain")
+ opts+=" --domain-id= -c --output-format= -o"
+ ;;
+ "create-ns")
+ opts+=" --nsze= -s --ncap= -c --flbas= -f \
+ --dps= -d --nmic= -m --anagrp-id= -a --nvmset-id= -i \
+ --block-size= -b --timeout= -t --csi= -y --lbstm= -l \
+ --nphndls= -n --nsze-si= -S --ncap-si= -C --azr -z --rar= -r \
+ --ror= -O --rnumzrwa= -u --phndls= -p --endg-id= -e"
+ ;;
+ "delete-ns")
+ opts+=" -namespace-id= -n --timeout= -t"
+ ;;
+ "attach-ns")
+ opts+=" --namespace-id= -n --controllers= -c"
+ ;;
+ "detach-ns")
+ opts+=" --namespace-id= -n --controllers= -c"
+ ;;
+ "get-ns-id")
+ opts+=$NO_OPTS
+ ;;
+ "get-log")
+ opts+=" --log-id= -i --log-len= -l --namespace-id= -n \
+ --aen= -a --lpo= -O --lsp= -s --lsi= -S \
+ --rae -r --uuid-index= -U --csi= -y --ot -O \
+ --raw-binary -b"
+ ;;
+ "supported-log-pages")
+ opts+=" --output-format= -o --human-readable -H"
+ ;;
+ "telemetry-log")
+ opts+=" --output-file= -O --host-generate= -g \
+ --controller-init -c --data-area= -d"
+ ;;
+ "fw-log")
+ opts+=" --raw-binary -b --output-format= -o"
+ ;;
+ "changed-ns-list-log")
+ opts+=" --output-format= -o --raw-binary -b"
+ ;;
+ "smart-log")
+ opts+=" --namespace-id= -n --raw-binary -b \
+ --output-format= -o"
+ ;;
+ "ana-log")
+ opts+=" --output-format -o"
+ ;;
+ "fid-support-effects-log")
+ opts+=" --output-format -o"
+ ;;
+ "error-log")
+ opts+=" --raw-binary -b --log-entries= -e \
+ --output-format= -o"
+ ;;
+ "effects-log")
+ opts+=" --output-format= -o --human-readable -H \
+ --raw-binary -b"
+ ;;
+ "endurance-log")
+ opts+=" --output-format= -o --group-id -g"
+ ;;
+ "predictable-lat-log")
+ opts+=" --nvmset-id= -i --raw-binary -b \
+ --output-format= -o"
+ ;;
+ "pred-lat-event-agg-log")
+ opts+=" --log-entries= -e --rae -r \
+ --raw-binary -b --output-format= -o"
+ ;;
+ "persistent-event-log")
+ opts+=" --action= -a --log-len= -l \
+ --raw-binary -b --output-format= -o"
+ ;;
+ "endurance-event-agg-log")
+ opts+=" --log-entries= -e --rae -r \
+ --raw-binary -b --output-format= -o"
+ ;;
+ "lba-status-log")
+ opts+=" --rae -r --output-format= -o"
+ ;;
+ "resv-notif-log")
+ opts+=" --output-format= -o"
+ ;;
+ "boot-part-log")
+ opts+=" --lsp -s --output-file= -f \
+ --output-format= -o"
+ ;;
+ "media-unit-stat-log")
+ opts+=" --dom-id= -d --output-format= -o \
+ --raw-binary -b"
+ ;;
+ "supported-cap-config-log")
+ opts+=" --dom-id= -d --output-format= -o \
+ --raw-binary -b"
+ ;;
+ "get-feature")
+ opts+=" --namespace-id= -n --feature-id= -f --sel= -s \
+ --data-len= -l --cdw11= --c -uuid-index= -U --raw-binary -b \
+ --human-readable -H"
+ ;;
+ "device-self-test")
+ opts+=" --namespace-id= -n --self-test-code= -s"
+ ;;
+ "self-test-log")
+ opts+=" --dst-entries= -e --output-format= -o \
+ --verbose -v"
+ ;;
+ "set-feature")
+ opts+=" --namespace-id= -n --feature-id= -f --value= -v \
+ --data-len= -l -data= -d --value= -v --save -s --uuid-index= -U \
+ --cdw12= -c"
+ ;;
+ "set-property")
+ opts+=" --offset= -O --value= -V"
+ ;;
+ "get-property")
+ opts=+" --offset= -O --human-readable -H"
+ ;;
+ "format")
+ opts+=" --namespace-id= -n --timeout= -t --lbaf= -l \
+ --ses= -s --pil= -p -pi= -i --ms= -m --reset -r"
+ ;;
+ "fw-commit")
+ opts+=" --slot= -s --action= -a --bpid= -b"
+ ;;
+ "fw-download")
+ opts+=" --fw= -f --xfer= -x --offset= -O"
+ ;;
+ "capacity-mgmt")
+ opts+=" --operation= -O --element-id= -i --cap-lower= -l \
+ --cap-upper= -u"
+ ;;
+ "lockdown")
+ opts+=" --ofi= -O --ifc= -f --prhbt= -p --scp= -s --uuid -U"
+ ;;
+ "admin-passthru")
+ opts+=" --opcode= -O --flags= -f --prefil= -p --rsvd= -R \
+ --namespace-id= -n --data-len= -l --metadata-len= -m \
+ --timeout= -t --cdw2= -2 --cdw3= -3 --cdw10= -4 \
+ --cdw11= -5 --cdw12= -6 --cdw13= -7 --cdw14= -8 \
+ --cdw15= -9 --input-file= -i --raw-binary -b \
+ --show-command -s --dry-run -d --read -r --write -w \
+ --latency -T"
+ ;;
+ "io-passthru")
+ opts+=" --opcode= -O --flags= -f --prefill= -p --rsvd= -R \
+ --namespace-id= -n --data-len= -l --metadata-len= -m \
+ --timeout= -t --cdw2= -2 --cdw3= -3 --cdw10= -4 \
+ --cdw11= -5 --cdw12= -6 --cdw13= -7 --cdw14= -8 \
+ --cdw15= -9 --input-file= -i --raw-binary -b \
+ --show-command -s --dry-run -d --read -r --write -w \
+ --latency -T"
+ ;;
+ "security-send")
+ opts+=" --namespace-id= -n --file= -f --nssf= -N --secp= -p \
+ --spsp= -s --tl= -t"
+ ;;
+ "security-recv")
+ opts+=" --namespace-id= -n --size= -x --secp= -p --spsp= -s \
+ --al= -t --raw-binary -b"
+ ;;
+ "get-lba-status")
+ opts+=" --namespace-id= -n --start-lba= -s --max-dw= -m \
+ --action= -a --range-len= -l --timeout= -t \
+ --output-format= -o"
+ ;;
+ "resv-acquire")
+ opts+=" --namespace-id= -n --crkey= -c --prkey= -p \
+ --rtype= -t --racqa= -a --iekey= -i"
+ ;;
+ "resv-register")
+ opts+=" --namespace-id= -n --crkey= -c --nrkey= -k \
+ --rrega= -r --cptpl= -p --iekey -i"
+ ;;
+ "resv-release")
+ opts+=" --namespace-id= -n --crkey -c --rtype= -t \
+ --rrela= -a --iekey -i"
+ ;;
+ "resv-report")
+ opts+=" --namespace-id= -n --numd= -d --eds -e \
+ --raw-binary= -b --output-format= -o"
+ ;;
+ "dsm")
+ opts+=" --namespace-id= -n --ctx-attrs= -a --blocks= -b\
+ --slbs= -s --ad -d --idw -w --idr -r --cdw11= -c"
+ ;;
+ "copy")
+ opts+=" --namespace-id= -n --sdlba= -d --blocks= -b --slbs= -s \
+ --limited-retry -l --force-unit-access -f \
+ --prinfow= -p --prinfor= -P \
+ --ref-tag= -r --expected-ref-tag= -R \
+ --app-tag= -a --expected-app-tag= -A \
+ --app-tag-mask= -m --expected-app-tag-mask= -M \
+ --dir-type= -T --dir-spec= -S --format= -F"
+ ;;
+ "flush")
+ opts+=" --namespace-id= -n"
+ ;;
+ "compare")
+ opts+=" --start-block= -s --block-count= -c --data-size= -z \
+ --metadata-size= -y --ref-tag= -r --data= -d \
+ --metadata= -M --prinfo= -p --app-tag-mask= -m \
+ --app-tag= -a --limited-retry -l \
+ --force-unit-access -f --storage-tag-check -C \
+ --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \
+ --dry-run -w --latency -t"
+ ;;
+ "read")
+ opts+=" --start-block= -s --block-count= -c --data-size= -z \
+ --metadata-size= -y --ref-tag= -r --data= -d \
+ --metadata= -M --prinfo= -p --app-tag-mask= -m \
+ --app-tag= -a --limited-retry -l \
+ --force-unit-access -f --storage-tag-check -C \
+ --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \
+ --dry-run -w --latency -t"
+ ;;
+ "write")
+ opts+=" --start-block= -s --block-count= -c --data-size= -z \
+ --metadata-size= -y --ref-tag= -r --data= -d \
+ --metadata= -M --prinfo= -p --app-tag-mask= -m \
+ --app-tag= -a --limited-retry -l \
+ --force-unit-access -f --storage-tag-check -C \
+ --dir-type= -T --dir-spec= -S --dsm= -D --show-command -V \
+ --dry-run -w --latency -t"
+ ;;
+ "write-zeroes")
+ opts+=" --namespace-id= -n --start-block= -s \
+ --block-count= -c --deac -d --limited-retry -l \
+ --force-unit-access -f --prinfo= -p --ref-tag= -r \
+ --app-tag-mask= -m --app-tag= -a \
+ --storage-tag= -S --storage-tag-check -C \
+ --dir-type= -T --dir-spec= -S"
+ ;;
+ "write-uncor")
+ opts+=" --namespace-id= -n --start-block= -s \
+ --block-count= -c --dir-type= -T --dir-spec= -S"
+ ;;
+ "verify")
+ opts+=" --namespace-id= -n --start-block= -s \
+ --block-count= -c --limited-retry -l \
+ --force-unit-access -f --prinfo= -p --ref-tag= -r \
+ --app-tag= -a --app-tag-mask= -m \
+ --storage-tag= -S --storage-tag-check -C"
+ ;;
+ "sanitize")
+ opts+=" --no-dealloc -d --oipbp -i --owpass= -n \
+ --ause -u --sanact= -a --ovrpat= -p"
+ case $opt in
+ --sanact|-a)
+ vals+=" exit-failure start-block-erase start-overwrite start-crypto-erase"
+ ;;
+ esac
+ ;;
+ "sanitize-log")
+ opts+=" --rae -r --output-format= -o --human-readable -H \
+ --raw-binary -b"
+ ;;
+ "reset")
+ opts+=$NO_OPTS
+ ;;
+ "subsystem-reset")
+ opts+=$NO_OPTS
+ ;;
+ "ns-rescan")
+ opts+=$NO_OPTS
+ ;;
+ "show-regs")
+ opts+=" --output-format= -o --human-readable -H"
+ ;;
+ "discover")
+ opts+=" --transport= -t -traddr= -a -trsvcid= -s \
+ --host-traddr= -w --host-iface= -f \
+ --hostnqn= -q --hostid -I --raw= -r \
+ --raw= -r --device= -d --keep-alive-tmo= -k \
+ --ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \
+ --tos= -T --hdr-digest= -g --data-digest -G \
+ --nr-io-queues= -i --nr-write-queues= -W \
+ --nr-poll-queues= -P --queue-size= -Q \
+ --persistent -p --quiet -S \
+ --output-format= -o"
+ ;;
+ "connect-all")
+ opts+=" --transport= -t -traddr= -a -trsvcid= -s \
+ --host-traddr= -w --host-iface= -f \
+ --hostnqn= -q --hostid -I --raw= -r \
+ --raw= -r --device= -d --keep-alive-tmo= -k \
+ --ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \
+ --tos= -T --hdr-digest= -g --data-digest -G \
+ --nr-io-queues= -i --nr-write-queues= -W \
+ --nr-poll-queues= -P --queue-size= -Q \
+ --persistent -p --quiet -S \
+ --output-format= -o"
+ ;;
+ "connect")
+ opts+=" --transport= -t --nqn= -n --traddr= -a --trsvcid -s \
+ --hostnqn= -q --host-id= -I --nr-io-queues= -i \
+ --nr-poll-queues= -P --queue-size= -Q \
+ --keep-alive-tmo= -k --reconnect-delay= -r \
+ --ctrl-loss-tmo= -l --fast-io-fail-tmo= -f \
+ --tos= -T --duplicate-connect -D --disable-sqflow -d\
+ --hdr-digest -g --data-digest -G --output-format= -o"
+ ;;
+ "dim")
+ opts+=" --task -t --nqn -n --device -d"
+ ;;
+ "disconnect")
+ opts+=" --nqn -n --device -d"
+ ;;
+ "disconnect-all")
+ opts+=$NO_OPTS
+ ;;
+ "gen-hostnqn")
+ opts+=$NO_OPTS
+ ;;
+ "show-hostnqn")
+ opts+=$NO_OPTS
+ ;;
+ "dir-receive")
+ opts+=" --namespace-id= -n --data-len= -l --raw-binary -b \
+ --dir-type= -D --dir-spec= -S --dir-oper= -O \
+ --req-resource= -r --human-readable -H"
+ ;;
+ "dir-send")
+ opts+=" --namespace-id= -n --data-len= -l --dir-type= -D \
+ --target-dir= -T --dir-spec= -S --dir-oper= -O \
+ --endir= -e --human-readable -H --raw-binary -b"
+ ;;
+ "virt-mgmt")
+ opts+=" --cntlid= -c --rt= -r --act= -a --nr= -n"
+ ;;
+ "rpmb")
+ opts+=" --cmd= -c --msgfile= -f --keyfile= -g \
+ --key= -k --msg= -d --address= -o --blocks= -b \
+ --target= -t"
+ ;;
+ "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
+ ;;
+ "help")
+ opts=$_cmds
+ ;;
+ esac
+
+ opts+=" -h --help -j --json"
+
+ if [[ $vals == " " ]]; then
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+ else
+ COMPREPLY+=( $( compgen $compargs -W "$vals" -- $val ) )
+ fi
+
+ return 0
+}
+
+plugin_intel_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
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "internal-log")
+ opts+=" --log= -l --region= -r --nlognum= -m \
+ --namespace-id= -n --output-file= -o \
+ --verbose-nlog -v"
+ ;;
+ "lat-stats")
+ opts+=" --write -w --raw-binary -b --json -j"
+ ;;
+ "set-bucket-thresholds")
+ opts+=" --write -w --bucket-thresholds= -t"
+ ;;
+ "lat-stats-tracking")
+ opts+=" --enable -e --disable -d"
+ ;;
+ "market-name")
+ opts+=" --raw-binary -b"
+ ;;
+ "smart-log-add")
+ opts+=" --namespace-id= -n --raw-binary -b \
+ --json -j"
+ ;;
+ "temp-stats")
+ opts+=" --raw-binary -b"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_amzn_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
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_memblaze_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
+ "smart-log-add")
+ opts+=" --namespace-id= -n --raw-binary -b"
+ ;;
+ "get-pm-status")
+ opts+=$NO_OPTS
+ ;;
+ "set-pm-status")
+ opts+=" --value= -v --save -s"
+ ;;
+ "select-download")
+ opts+=" --fw= -f --select= -s"
+ ;;
+ "lat-stats")
+ opts+=" --enable -e --disable -d"
+ ;;
+ "lat-stats-print")
+ opts+=" --write -w"
+ ;;
+ "lat-log")
+ opts+=" --param= -p"
+ ;;
+ "lat-log-print")
+ opts+=$NO_OPTS
+ ;;
+ "clear-error-log")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_wdc_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
+ "cap-diag")
+ opts+=" --output-file= -o --transfer-size= -s"
+ ;;
+ "drive-log")
+ opts+=" --output-file= -o"
+ ;;
+ "get-crash-dump")
+ opts+=" --output-file= -o"
+ ;;
+ "get-pfail-dump")
+ opts+=" --output-file= -o"
+ ;;
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "purge")
+ opts+=$NO_OPTS
+ ;;
+ "purge-monitor")
+ opts+=$NO_OPTS
+ ;;
+ "vs-internal-log")
+ opts+=" --output-file= -o --transfer-size= -s --data-area= -d \
+ --file-size= -f --offset= -e --type= -t --verbose -v"
+ ;;
+ "vs-nand-stats")
+ opts+=" --output-format= -o"
+ ;;
+ "vs-smart-add-log")
+ opts+=" --interval= -i --output-format= -o --log-page-version= -l \
+ --log-page-mask= -p"
+ ;;
+ "clear-pcie-correctable-errors")
+ opts+=$NO_OPTS
+ ;;
+ "drive-essentials")
+ opts+=" --dir-name= -d"
+ ;;
+ "get-drive-status")
+ opts+=$NO_OPTS
+ ;;
+ "clear-assert-dump")
+ opts+=$NO_OPTS
+ ;;
+ "drive-resize")
+ opts+=" --size= -s"
+ ;;
+ "vs-fw-activate-history")
+ opts+=" --output-format= -o"
+ ;;
+ "clear-fw-activate-history")
+ opts+=$NO_OPTS
+ ;;
+ "enc-get-log")
+ opts+=" --output-file= -o --transfer-size= -s --log-id= -l"
+ ;;
+ "vs-telemetry-controller-option")
+ opts+=" --disable -d --enable -e --status -s"
+ ;;
+ "vs-error-reason-identifier")
+ opts+=" --log-id= -i --file= -o"
+ ;;
+ "log-page-directory")
+ opts+=" --output-format= -o"
+ ;;
+ "namespace-resize")
+ opts+=" --namespace-id= -n --op-option= -o"
+ ;;
+ "vs-drive-info")
+ opts+=" --output-format= -o"
+ ;;
+ "vs-temperature-stats")
+ opts+=" --output-format= -o"
+ ;;
+ "capabilities")
+ opts+=$NO_OPTS
+ ;;
+ "cloud-SSD-plugin-version")
+ opts+=$NO_OPTS
+ ;;
+ "vs-pcie-stats")
+ opts+=" --output-format= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_huawei_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
+ "list")
+ opts+=" --output-format= -o"
+ ;;
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_toshiba_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
+ "vs-smart-add-log")
+ opts+=" --namespace-id= -n --output-file= -o --log= -l"
+ ;;
+ "vs-internal-log")
+ opts+=" --output-file= -o --prev-log -p"
+ ;;
+ "clear-pcie-correctable-errors")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_micron_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
+ "select-download")
+ opts+=" --fw= -f --select= -s"
+ ;;
+ "vs-temperature-stats")
+ opts+=" --format= -f"
+ ;;
+ "vs-pcie-stats")
+ opts+=" --format= -f"
+ ;;
+ "clear-pcie-correctable-errors")
+ opts+=$NO_OPTS
+ ;;
+ "vs-internal-log")
+ opts+=" --type= -t --package= -p --data_area= -d"
+ ;;
+ "vs-telemetry-controller-option")
+ opts+=" --option= -o --select= -s"
+ ;;
+ "vs-nand-stats")
+ opts+=" --format= -f"
+ ;;
+ "vs-drive-info")
+ opts+=" --format= -f"
+ ;;
+ "plugin-version")
+ opts+=$NO_OPTS
+ ;;
+ "cloud-SSD-plugin-version")
+ opts+=$NO_OPTS
+ ;;
+ "log-page-directory")
+ opts+=$NO_OPTS
+ ;;
+ "vs-fw-activate-history")
+ opts+=" --format= -f"
+ ;;
+ "vs-error-reason-identifier")
+ opts+=" --format= -f"
+ ;;
+ "vs-smart-add-log")
+ opts+=" --format= -f"
+ ;;
+ "clear-fw-activate-history")
+ opts+=$NO_OPTS
+ ;;
+ "vs-smbus-option")
+ opts+=" --option= -o --value= -v --save= -s"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_seagate_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
+ "vs-temperature-stats")
+ opts+=" --output-format= -o"
+ ;;
+ "vs-log-page-sup")
+ opts+=" --output-format= -o"
+ ;;
+ "vs-smart-add-log")
+ opts+=" --output-format= -o"
+ ;;
+ "vs-pcie-stats")
+ opts+=" --output-format= -o"
+ ;;
+ "clear-pcie-correctable-errors")
+ opts+=" --save -s"
+ ;;
+ "get-host-tele")
+ opts+=" --namespace-id= -n --log-specific= -i --raw-binary -b"
+ ;;
+ "get-ctrl-tele")
+ opts+=" --namespace-id= -n --raw-binary -b"
+ ;;
+ "vs-internal-log")
+ opts+=" --namespace-id= -n --dump-file= -f"
+ ;;
+ "plugin-version")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=""
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_virtium_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
+ "save-smart-to-vtview-log")
+ opts+=" --run-time= -r --freq= -f --output-file= -o --test-name= -n"
+ ;;
+ "show-identify")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_shannon_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
+ "smart-log-add")
+ opts+=" --namespace-id= -n --raw-binary -b"
+ ;;
+ "get-feature-add")
+ opts+=" --namespace-id= -n --feature-id -f --sel= -s \
+ --data-len= -l --raw-binary -b --cdw11= -c --human-readable -H"
+ ;;
+ "set-feature-add")
+ opts+=" --namespace-id= -n --feature-id= -f --value= -V \
+ --data-len= -l --data= -d --save -s"
+ ;;
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_dera_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
+ "smart-log-add")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_sfx_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
+ "smart-log-add")
+ opts+=" --namespace-id= -n --raw-binary -b --json -j"
+ ;;
+ "lat-stats")
+ opts+=" --write -w --raw-binary -b"
+ ;;
+ "get-bad-block")
+ opts+=$NO_OPTS
+ ;;
+ "query-cap")
+ opts+=" --raw-binary --json"
+ ;;
+ "change-cap")
+ opts+=" --cap= -c --cap-byte= -z --force -f --raw-binary -b --json -j"
+ ;;
+ "set-feature")
+ opts+=" --namespace-id= -n --feature-id= -f --value= -v --force -s"
+ ;;
+ "get-feature")
+ opts+=" --namespace-id= -n --feature-id -f"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_solidigm_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
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o \
+ --verbose -v "
+ ;;
+ "vs-smart-add-log")
+ opts+="--output-format= -o"
+ ;;
+ "garbage-collect-log")
+ opts+="--output-format= -o"
+ ;;
+ "vs-internal-log")
+ opts+=" --type= -t --namespace-id= -n \
+ --file-prefix= -p --verbose -v"
+ ;;
+ "latency-tracking-log")
+ opts+=" --enable -e --disable -d \
+ --read -r --write -w \
+ --type -t --output-format -o"
+ ;;
+ "clear-pcie-correctable-errors")
+ opts+=" --no-uuid -n"
+ ;;
+ "parse-telemetry-log")
+ opts+=" --host-generate -g --controller-init -c \
+ --data-area -d --config-file -j \
+ --source-file -s"
+ ;;
+ "clear-fw-activate-history")
+ opts+=" --no-uuid -n"
+ ;;
+ "vs-fw-activate-history")
+ opts+=" --output-format -o"
+ ;;
+ "log-page-directory")
+ opts+=" --output-format -o"
+ ;;
+ "vs-drive-info")
+ opts+=" "
+ ;;
+ "cloud-SSDplugin-version")
+ opts+=$NO_OPTS
+ ;;
+ "market-log")
+ opts+=" --raw-binary -b"
+ ;;
+ "smart-log-add")
+ opts+=" --namespace-id= -n --output-format -o"
+ ;;
+ "temp-stats")
+ opts+=" --raw-binary -b"
+ ;;
+ "version")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_transcend_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
+ "healthvalue")
+ opts+=$NO_OPTS
+ ;;
+ "badblock")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_zns_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
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "id-ns")
+ opts+=" --namespace-id= -n --vendor-specific -v \
+ --output-format= -o --human-readable -H"
+ ;;
+ "zone-mgmt-recv")
+ opts+=" --output-format= -o --namespace-id= -n \
+ --start-lba= -s --zra= -z --zrasf= -S --partial -p \
+ --data-len= -l"
+ ;;
+ "zone-mgmt-send")
+ opts+=" --namespace-id= -n --start-lba= -s --zsaso -o \
+ --select-all -a --zsa= -z --data-len= -l \
+ --data= -d --timeout= -t"
+ ;;
+ "report-zones")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --descs= -d --state= -S --output-format= -o \
+ --human-readable -H --extended -e --partial -p"
+ ;;
+ "close-zone")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --select-all -a --timeout= -t"
+ ;;
+ "finish-zone")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --select-all -a --timeout= -t"
+ ;;
+ "open-zone")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --select-all -a --timeout= -t --zrwa -r"
+ ;;
+ "reset-zone")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --select-all -a --timeout= -t"
+ ;;
+ "offline-zone")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --select-all -a --timeout= -t"
+ ;;
+ "set-zone-desc")
+ opts+=" --namespace-id= -n --start-lba= -s \
+ --data= -d --timeout= -t --zrwa -r"
+ ;;
+ "flush-zone")
+ opts+=" --namespace-id= -n --last-lba= -l --timeout= -t"
+ ;;
+ "zone-append")
+ opts+=" --namespace-id= -n --zslba= -s --data-size= -z \
+ --metadata-size= -y --data= -d --metadata= -M \
+ --limited-retry -l --force-unit-access -f --ref-tag= -r
+ --app-tag-mask= -m --app-tag= -a --prinfo= -p \
+ --piremap -P --latency -t"
+ ;;
+ "changed-zone-list")
+ opts+=" --namespace-id= -n --output-format= -o --rae -r"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_nvidia_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
+ "id-ctrl")
+ opts+=" --raw-binary -b --human-readable -H \
+ --vendor-specific -v --output-format= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_ymtc_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
+ "smart-log-add")
+ opts+=" --namespace-id= -n --raw-binary -b"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_inspur_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
+ "nvme-vendor-log")
+ opts+=$NO_OPTS
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+plugin_ocp_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
+ "smart-add-log")
+ opts+=" --output-format= -o"
+ ;;
+ "latency-monitor-log")
+ opts+=" --output-format= -o"
+ ;;
+ "set-latency-monitor-feature")
+ opts+=" --active_bucket_timer_threshold= -t \
+ --active_threshold_a= -a --active_threshold_b= -b \
+ --active_threshold_c= -c --active_threshold_d= -d \
+ --active_latency_config= -f \
+ --active_latency_minimum_window= -w \
+ --debug_log_trigger_enable -r --discard_debug_log= -l \
+ --latency_monitor_feature_enable= -e"
+ ;;
+ "internal-log")
+ opts+=" --telemetry_type= -t --telemetry_data_area= -a \
+ --output-file= -o"
+ ;;
+ "clear-fw-activate-history")
+ opts+=" --no-uuid -n"
+ ;;
+ "eol-plp-failure-mode")
+ opts+=" --mode= -m --save -s --sel= -S --no-uuid -n"
+ ;;
+ "clear-pcie-correctable-error-counters")
+ opts+=" --no-uuid -n"
+ ;;
+ "fw-activate-history")
+ opts+=" --output-format= -o"
+ ;;
+ "device-capability-log")
+ opts+=" --output-format= -o"
+ ;;
+ "set-dssd-power-state-feature")
+ opts+=" --power-state= -p --no-uuid -n --save -s"
+ ;;
+ "telemetry-string-log")
+ opts+=" --output-file= -o"
+ ;;
+ "help")
+ opts+=$NO_OPTS
+ ;;
+ esac
+
+ COMPREPLY+=( $( compgen $compargs -W "$opts" -- $cur ) )
+
+ return 0
+}
+
+_nvme_subcmds () {
+ local cur prev words cword
+ _init_completion || return
+
+ # Constant to indicate command has no options
+ NO_OPTS=""
+
+ # Associative array of plugins and associated subcommands
+ # Order here is same as PLUGIN_OBJS in Makefile
+ typeset -Ar _plugin_subcmds=(
+ [intel]="id-ctrl internal-log lat-stats \
+ set-bucket-thresholds lat-stats-tracking \
+ market-name smart-log-add temp-stats"
+ [amzn]="id-ctrl"
+ [memblaze]="smart-log-add get-pm-status set-pm-status \
+ select-download lat-stats lat-stats-print lat-log \
+ lat-log-print clear-error-log"
+ [wdc]="cap-diag drive-log get-crash-dump get-pfail-dump \
+ id-ctrl purge purge-monitor vs-internal-log \
+ vs-nand-stats vs-smart-add-log clear-pcie-correctable-errors \
+ drive-essentials get-drive-status clear-assert-dump \
+ drive-resize vs-fw-activate-history clear-fw-activate-history \
+ enc-get-log vs-telemetry-controller-option \
+ vs-error-reason-identifier log-page-directory \
+ namespace-resize vs-drive-info vs-temperature-stats \
+ capabilities cloud-SSD-plugin-version vs-pcie-stats"
+ [huawei]="list id-ctrl"
+ [netapp]="smdevices ontapdevices"
+ [toshiba]="vs-smart-add-log vs-internal-log \
+ clear-pcie-correctable-errors"
+ [micron]="select-download vs-temperature-stats vs-pcie-stats \
+ clear-pcie-correctable-errors vs-internal-log \
+ vs-telemetry-controller-option vs-nand-stats \
+ vs-drive-info plugin-version cloud-SSD-plugin-version \
+ log-page-directory vs-fw-activate-history \
+ vs-error-reason-identifier vs-smart-add-log \
+ clear-fw-activate-history vs-smbus-option"
+ [seagate]="vs-temperature-stats vs-log-page-sup \
+ vs-smart-add-log vs-pcie-stats clear-pcie-correctable-errors \
+ get-host-tele get-ctrl-tele vs-internal-log \
+ plugin-version"
+ [virtium]="save-smart-to-vtview-log show-identify"
+ [shannon]="smart-log-add get-feature-add set-feature-add id-ctrl"
+ [dera]="smart-log-add"
+ [sfx]="smart-log-add lat-stats get-bad-block query-cap \
+ change-cap set-feature get-feature"
+ [solidigm]="id-ctrl vs-smart-add-log garbage-collect-log \
+ vs-internal-log latency-tracking-log \
+ clear-pcie-correctable-errors parse-telemetry-log \
+ clear-fw-activate-history vs-fw-activate-history log-page-directory \
+ vs-drive-info cloud-SSDplugin-version market-log \
+ smart-log-add temp-stats version help"
+ [transcend]="healthvalue badblock"
+ [zns]="id-ctrl id-ns zone-mgmt-recv \
+ zone-mgmt-send report-zones close-zone \
+ finish-zone open-zone reset-zone offline-zone \
+ set-zone-desc zone-append changed-zone-list"
+ [nvidia]="id-ctrl"
+ [ymtc]="smart-log-add"
+ [inspur]="nvme-vendor-log"
+ [ocp]="smart-add-log latency-monitor-log \
+ set-latency-monitor-feature internal-log \
+ clear-fw-activate-history eol-plp-failure-mode \
+ clear-pcie-correctable-error-counters \
+ vs-fw-activate-history device-capability-log \
+ set-dssd-power-state-feature telemetry-string-log"
+ )
+
+ # Associative array mapping plugins to corresponding option completions
+ typeset -Ar _plugin_funcs=(
+ [intel]="plugin_intel_opts"
+ [amzn]="plugin_amzn_opts"
+ [memblaze]="plugin_memblaze_opts"
+ [wdc]="plugin_wdc_opts"
+ [huawei]="plugin_huawei_opts"
+ [toshiba]="plugin_toshiba_opts"
+ [micron]="plugin_micron_opts"
+ [seagate]="plugin_seagate_opts"
+ [virtium]="plugin_virtium_opts"
+ [shannon]="plugin_shannon_opts"
+ [dera]="plugin_dera_opts"
+ [sfx]="plugin_sfx_opts"
+ [solidigm]="plugin_solidigm_opts"
+ [transcend]="plugin_transcend_opts"
+ [zns]="plugin_zns_opts"
+ [nvidia]="plugin_nvidia_opts"
+ [ymtc]="plugin_ymtc_opts"
+ [inspur]="plugin_inspur_opts"
+ [ocp]="plugin_ocp_opts"
+ )
+
+ # Top level commands
+ _cmds="list list-subsys id-ctrl id-ns \
+ id-ns-granularity list-ns list-ctrl \
+ id-ns-lba-format nvm-id-ns nvm-id-ns-lba-format \
+ nvm-id-ctrl primary-ctrl-caps list-secondary \
+ ns-descs id-nvmset id-uuid id-iocs id-domain create-ns \
+ delete-ns get-ns-id get-log telemetry-log \
+ fw-log changed-ns-list-log smart-log ana-log \
+ error-log effects-log endurance-log \
+ predictable-lat-log pred-lat-event-agg-log \
+ persistent-event-log endurance-agg-log \
+ lba-status-log resv-notif-log get-feature \
+ device-self-test self-test-log set-feature \
+ set-property get-property format fw-commit \
+ fw-download admin-passthru io-passthru \
+ security-send security-recv get-lba-status \
+ resv-acquire resv-register resv-release \
+ resv-report dsm copy flush compare read \
+ write write-zeros write-uncor verify \
+ 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 \
+ 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 \
+ nvme-mi-recv nvme-mi-send"
+
+ # Add plugins:
+ for plugin in "${!_plugin_subcmds[@]}"; do
+ _cmds+=" $plugin"
+ done
+
+ _cmds+=" version help"
+
+ if [[ ${#words[*]} -lt 3 ]]; then
+ COMPREPLY+=( $(compgen -W "$_cmds" -- $cur ) )
+ else
+ for subcmd in "${!_plugin_subcmds[@]}"; do
+ if [[ ${words[1]} == $subcmd ]]; then
+ if [[ ${#words[*]} -lt 4 ]]; then
+ COMPREPLY+=( $(compgen -W "${_plugin_subcmds[$subcmd]}" -- $cur ) )
+ else
+ func=${_plugin_funcs[$subcmd]}
+ $func ${words[2]} $prev
+ fi
+ return 0
+ fi
+ done
+
+ nvme_list_opts ${words[1]} $prev
+ fi
+
+ return 0
+}
+
+complete -o default -F _nvme_subcmds nvme