Skip to content

Commit

Permalink
completions: Add timeout option zsh completions
Browse files Browse the repository at this point in the history
Added the option as a nvme default option.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
  • Loading branch information
ikegami-t committed Apr 14, 2024
1 parent 984b41c commit cd84329
Showing 1 changed file with 75 additions and 11 deletions.
86 changes: 75 additions & 11 deletions completions/_nvme
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ _nvme () {
-a':alias of --all'
--output-format=':Output format: normal|json|binary'
-o':alias for --output-format'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme list-ns options" _listns
Expand Down Expand Up @@ -1030,6 +1032,8 @@ _nvme () {
-b':alias to --raw-binary'
--csi=':command set identifier'
-c':alias of --csi'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme effects-log options" _effects_log
Expand Down Expand Up @@ -1107,6 +1111,8 @@ _nvme () {
--cdw11=':dword 11 value, used for interrupt vector configuration only'
--raw-binary':dump infos in binary format'
-b':alias to --raw-binary'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme get-feature options" _getf
Expand All @@ -1121,6 +1127,8 @@ _nvme () {
-s':alias for --self-test-code'
--wait':Wait for the test to finish'
-w':alias to --wait'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme device-self-test options" _device_self_test
Expand Down Expand Up @@ -1153,6 +1161,8 @@ _nvme () {
-s':alias of --scp'
--uuid=':UUID Index field required aligned with Scope'
-U':alias of --uuid'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme lockdown options" _lockdown
Expand All @@ -1173,6 +1183,8 @@ _nvme () {
-V'alias to --value'
--uuid-index=':uuid index'
-U':alias for --uuid-index'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme set-feature options" _setf
Expand All @@ -1185,6 +1197,8 @@ _nvme () {
-O':alias to --offset'
--value=':the value of the property to be set'
-V':alias to --value'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme set-property options" _set_property
Expand All @@ -1197,6 +1211,8 @@ _nvme () {
-O':alias to --offset'
--human-readable':show infos in readable format'
-H':alias of --human-readable'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme get-property options" _get_property
Expand Down Expand Up @@ -1231,6 +1247,8 @@ _nvme () {
-a':alias of --action'
--slot=':firmware slot to activate'
-s':alias of --slot'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme fw-commit options" _fw_commit
Expand All @@ -1245,13 +1263,15 @@ _nvme () {
-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'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme fw-download options" _fwd
;;
(capacity-mgmt)
local _fwd
_fwd=(
local _capacity_mgmt
_capacity_mgmt=(
/dev/nvme':supply a device to use (required)'
--operation=':Operation to be performed by the controller'
-O':alias of --operation'
Expand All @@ -1261,9 +1281,11 @@ _nvme () {
-l':alias of --cap-lower'
--cap-upper=':Most significant 32 bits of the capacity in bytes'
-u':alias of --cap-upper'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme capacity-mgmt options" _fwd
_describe -t commands "nvme capacity-mgmt options" _capacity_mgmt
;;
(write-zeroes)
local _write_zeroes
Expand Down Expand Up @@ -1297,6 +1319,8 @@ _nvme () {
-C':alias of --storage-tag-check'
--dir-spec=':directive specific'
-D':alias of --dir-spec'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme write-zeroes options" _write_zeroes
Expand All @@ -1315,6 +1339,8 @@ _nvme () {
-T':alias of --dir-type'
--dir-spec':directive specific'
-S':alias of --dir-spec'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme write-uncor options" _write_uncor
Expand Down Expand Up @@ -1345,6 +1371,8 @@ _nvme () {
-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'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme verify options" _verify
Expand Down Expand Up @@ -1554,7 +1582,9 @@ _nvme () {
--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'
-l':alias for --tl'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme security-send options" _ssend
Expand All @@ -1570,9 +1600,11 @@ _nvme () {
--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'
-l':alias for --al'
--raw-binary':dump output in binary format'
-b':alias for --raw-binary'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme security-recv options" _srecv
Expand Down Expand Up @@ -1608,13 +1640,15 @@ _nvme () {
--prkey=':pre-empt reservation key'
-p':alias for --prkey'
--rtype=':hexadecimal reservation type'
-t':alias for --rtype'
-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'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme resv-acquire options" _acq
Expand All @@ -1626,11 +1660,13 @@ _nvme () {
--namespace-id=':nsid'
-n':alias of --namespace-id'
--rtype=':hexadecimal reservation type'
-t':alias of --rtype'
-T':alias of --rtype'
--rrela=':reservation release action'
-a':alias of --rrela'
--iekey':ignore existing reservation key'
-i':alias of --iekey'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme resv-release options" _rel
Expand All @@ -1647,6 +1683,8 @@ _nvme () {
-e':alias of --eds'
--raw-binary':dump output in binary format'
-b':alias of --raw-binary'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme resv-report options" _rep
Expand All @@ -1667,6 +1705,8 @@ _nvme () {
-r':alias for --rrega'
--iekey':ignore existing reservation key'
-i':alias for --iekey'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme resv-register options" _reg
Expand All @@ -1691,6 +1731,8 @@ _nvme () {
-r':alias of --idr'
--cdw11=':value for command dword 11'
-c':alias for --cdw11'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme dsm options" _dsm
Expand Down Expand Up @@ -1731,10 +1773,12 @@ _nvme () {
-S':alias of --dir-spec'
--format=':source range entry format'
-F':alias of --format'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme copy options" _copy
;;
_describe -t commands "nvme copy options" _copy
;;
(flush)
local _flush
_flush=(
Expand Down Expand Up @@ -1773,6 +1817,10 @@ _nvme () {
-V':alias of --show-command'
--dry-run':show command instead of sending to device'
-w':alias of --show-command'
--latency':latency statistics will be output following compare'
-L':alias of --latency'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme compare options" _comp
Expand Down Expand Up @@ -1802,13 +1850,15 @@ _nvme () {
--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'
-L':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'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme read options" _read
Expand Down Expand Up @@ -1838,13 +1888,15 @@ _nvme () {
--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'
-L':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'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme write options" _wr
Expand All @@ -1853,6 +1905,8 @@ _nvme () {
local _shor
_shor=(
/dev/nvme':supply a device to use (required)'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme show-regs options" _shor
Expand Down Expand Up @@ -2144,6 +2198,8 @@ _nvme () {
-r':alias of --req-resource'
--human-readable':show infos in readable format'
-H':alias of --human-readable'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme dir-receive options" _dir_receive
Expand Down Expand Up @@ -2172,6 +2228,8 @@ _nvme () {
-b':alias for --raw-binary'
--input-file=':write/send file (default stdin)'
-i':alias of --input-file'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme dir-send options" _dir_send
Expand All @@ -2188,6 +2246,8 @@ _nvme () {
-a':alias of --act'
--nr=':Number of Controller Resources(NR)'
-n':alias of --nr'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme virt-mgmt options" _virt_mgmt
Expand Down Expand Up @@ -2313,6 +2373,8 @@ _nvme () {
-o ':alias for --output-format'
--verbose':Increase the information detail in the output.'
-v':alias for --verbose'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme get-reg options" _get_reg
Expand Down Expand Up @@ -2346,6 +2408,8 @@ _nvme () {
-o ':alias for --output-format'
--verbose':Increase the information detail in the output.'
-v':alias for --verbose'
--timeout=':value for timeout'
-t':alias of --timeout'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme set-reg options" _set_reg
Expand Down

0 comments on commit cd84329

Please sign in to comment.