@@ -45,13 +45,10 @@ static int fdp_configs(int argc, char **argv, struct command *acmd,
4545 .raw_binary = false,
4646 };
4747
48- OPT_ARGS (opts ) = {
48+ NVME_ARGS (opts ,
4949 OPT_UINT ("endgrp-id" , 'e' , & cfg .egid , egid ),
50- OPT_FMT ("output-format" , 'o' , & cfg .output_format , output_format ),
5150 OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
52- OPT_FLAG ("human-readable" , 'H' , & cfg .human_readable , human_readable ),
53- OPT_END ()
54- };
51+ OPT_FLAG ("human-readable" , 'H' , & cfg .human_readable , human_readable ));
5552
5653 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
5754 if (err )
@@ -120,12 +117,9 @@ static int fdp_usage(int argc, char **argv, struct command *acmd, struct plugin
120117 .raw_binary = false,
121118 };
122119
123- OPT_ARGS (opts ) = {
120+ NVME_ARGS (opts ,
124121 OPT_UINT ("endgrp-id" , 'e' , & cfg .egid , egid ),
125- OPT_FMT ("output-format" , 'o' , & cfg .output_format , output_format ),
126- OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
127- OPT_END ()
128- };
122+ OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ));
129123
130124 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
131125 if (err )
@@ -186,12 +180,9 @@ static int fdp_stats(int argc, char **argv, struct command *acmd, struct plugin
186180 .raw_binary = false,
187181 };
188182
189- OPT_ARGS (opts ) = {
183+ NVME_ARGS (opts ,
190184 OPT_UINT ("endgrp-id" , 'e' , & cfg .egid , egid ),
191- OPT_FMT ("output-format" , 'o' , & cfg .output_format , output_format ),
192- OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
193- OPT_END ()
194- };
185+ OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ));
195186
196187 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
197188 if (err )
@@ -249,13 +240,10 @@ static int fdp_events(int argc, char **argv, struct command *acmd, struct plugin
249240 .raw_binary = false,
250241 };
251242
252- OPT_ARGS (opts ) = {
243+ NVME_ARGS (opts ,
253244 OPT_UINT ("endgrp-id" , 'e' , & cfg .egid , egid ),
254245 OPT_FLAG ("host-events" , 'E' , & cfg .host_events , host_events ),
255- OPT_FMT ("output-format" , 'o' , & cfg .output_format , output_format ),
256- OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
257- OPT_END ()
258- };
246+ OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ));
259247
260248 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
261249 if (err )
@@ -313,12 +301,9 @@ static int fdp_status(int argc, char **argv, struct command *acmd, struct plugin
313301 .raw_binary = false,
314302 };
315303
316- OPT_ARGS (opts ) = {
304+ NVME_ARGS (opts ,
317305 OPT_UINT ("namespace-id" , 'n' , & cfg .nsid , namespace_id ),
318- OPT_FMT ("output-format" , 'o' , & cfg .output_format , output_format ),
319- OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ),
320- OPT_END ()
321- };
306+ OPT_FLAG ("raw-binary" , 'b' , & cfg .raw_binary , raw ));
322307
323308 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
324309 if (err )
@@ -388,11 +373,9 @@ static int fdp_update(int argc, char **argv, struct command *acmd, struct plugin
388373 .pids = "" ,
389374 };
390375
391- OPT_ARGS (opts ) = {
376+ NVME_ARGS (opts ,
392377 OPT_UINT ("namespace-id" , 'n' , & cfg .nsid , namespace_id ),
393- OPT_LIST ("pids" , 'p' , & cfg .pids , _pids ),
394- OPT_END ()
395- };
378+ OPT_LIST ("pids" , 'p' , & cfg .pids , _pids ));
396379
397380 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
398381 if (err )
@@ -459,14 +442,12 @@ static int fdp_set_events(int argc, char **argv, struct command *acmd, struct pl
459442 .sv = false,
460443 };
461444
462- OPT_ARGS (opts ) = {
445+ NVME_ARGS (opts ,
463446 OPT_UINT ("namespace-id" , 'n' , & cfg .nsid , nsid ),
464447 OPT_SHRT ("placement-handle" , 'p' , & cfg .ph , ph ),
465448 OPT_FLAG ("enable" , 'e' , & cfg .enable , enable ),
466449 OPT_FLAG ("save" , 's' , & cfg .sv , sv ),
467- OPT_LIST ("event-types" , 't' , & cfg .event_types , event_types ),
468- OPT_END ()
469- };
450+ OPT_LIST ("event-types" , 't' , & cfg .event_types , event_types ));
470451
471452 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
472453 if (err )
@@ -537,13 +518,10 @@ static int fdp_feature(int argc, char **argv, struct command *acmd, struct plugi
537518 .endgid = 0 ,
538519 };
539520
540- OPT_ARGS (opts ) = {
521+ NVME_ARGS (opts ,
541522 OPT_SHRT ("endgrp-id" , 'e' , & cfg .endgid , endurance_group ),
542523 OPT_BYTE ("enable-conf-idx" , 'c' , & cfg .fdpcidx , enable_conf_idx ),
543- OPT_FLAG ("disable" , 'd' , & cfg .disable , disable ),
544- OPT_INCR ("verbose" , 'v' , & nvme_cfg .verbose , verbose ),
545- OPT_END ()
546- };
524+ OPT_FLAG ("disable" , 'd' , & cfg .disable , disable ));
547525
548526 err = parse_and_open (& ctx , & hdl , argc , argv , desc , opts );
549527 if (err )
0 commit comments