summaryrefslogtreecommitdiffstats
path: root/completions/_nvme
blob: 591089863e0e8eb181345f04b468b55acef972ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
#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=(
	'id-ctrl:display information about the controller'
	'id-ns:display information about the namespace'
	'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'
	'id-ns-lba-format:display information about the namespace of nvm command set capability fields for specific LBA format'
	'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 presistent event log'
	'fw-log:retrieve fw log'
	'smart-log:retrieve SMART log'
	'smart-log-add:retrieve additional SMART log'
	'error-log:retrieve error 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'
	'set-feature:set a controller feature and show results'
	'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 IOCTL'
	'io-passthru:submit a passthrough IOCTL'
	'security-send:send security/secure data to controller'
	'security-recv:ask for security/secure data from controller'
	'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'
	'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'
	'show-regs:shows the controller registers; requires 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 support log pages details'
	'show-topology: show subystem topology'
	'help:print brief descriptions of all nvme commands'
	)

	local expl

	_arguments '*:: :->subcmds' && return 0

	if (( CURRENT == 1 )); then
		_describe -t commands "nvme subcommands" _cmds
		return
	else
		case ${words[CURRENT-1]} in
		(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-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'
			)
			_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
			;;
		(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
			;;
		(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-ns 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'
			-n':alias of --nmic'
			--csi=':command set identifier'
			-y':alias of --csi'
			)
			_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'
			)
			_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'
			)
			_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 "persistent-event-log options" _persistenteventlog
			;;
		(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
			;;
		(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
			;;
		(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
			;;
		(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
			;;
		(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
			;;
		(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'
			--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
			;;
		(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
			;;
		(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
			;;
		(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
			;;
		(show-topology)
			local _showtopology
			_showtopology=(
			--output-format=':Output format: normal|json|binary'
			-o':alias for --output-format'
			--verbose':show infos verbosely'
			-v':alias of --verbose'
			--ranking=':Ranking order: namespace|ctrl'
			-r':alias for --ranking'
			)
			_arguments '*:: :->subcmds'
			_describe -t commands "nvme show-topology options" _showtopology
			;;
		(help)
			local _h
			_h=( id-ctrl id-ns list-ns id-iocs create-ns delete-ns attach-ns detach-ns
			     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
			   )
			_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
}