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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions plugins/dapustor/dapustor-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,7 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
#ifdef CONFIG_JSONC
OPT_FLAG("json", 'j', &cfg.json, json),
#endif /* CONFIG_JSONC */
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};

Expand Down
8 changes: 2 additions & 6 deletions plugins/intel/intel-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
#ifdef CONFIG_JSONC
OPT_FLAG("json", 'j', &cfg.json, json),
#endif /* CONFIG_JSONC */
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};

Expand Down Expand Up @@ -1069,9 +1067,7 @@ static int get_lat_stats_log(int argc, char **argv, struct command *cmd, struct
OPT_ARGS(opts) = {
OPT_FLAG("write", 'w', &cfg.write, write),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
#ifdef CONFIG_JSONC
OPT_FLAG("json", 'j', &cfg.json, json),
#endif /* CONFIG_JSONC */
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};

Expand Down
2 changes: 1 addition & 1 deletion plugins/scaleflux/sfx-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static int get_additional_smart_log(int argc, char **argv, struct command *cmd,
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_FLAG("json", 'j', &cfg.json, json),
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};

Expand Down
2 changes: 1 addition & 1 deletion plugins/ssstc/ssstc-nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ int ssstc_get_add_smart_log(int argc, char **argv, struct command *cmd, struct p
OPT_ARGS(opts) = {
OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace),
OPT_FLAG("raw-binary", 'b', &cfg.raw_binary, raw),
OPT_FLAG("json", 'j', &cfg.json, json),
OPT_FLAG_JSON("json", 'j', &cfg.json, json),
OPT_END()
};

Expand Down
6 changes: 6 additions & 0 deletions util/argconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ enum argconfig_types {
#define OPT_LIST(l, s, v, d, ...) OPT_STRING(l, s, "LIST", v, d, __VA_ARGS__)
#define OPT_STR(l, s, v, d, ...) OPT_STRING(l, s, "STRING", v, d, __VA_ARGS__)

#ifdef CONFIG_JSONC
#define OPT_FLAG_JSON(l, s, v, d, ...) OPT_FLAG(l, s, v, d, __VA_ARGS__)
#else /* CONFIG_JSONC */
#define OPT_FLAG_JSON(l, s, v, d, ...) OPT_END()
#endif /* CONFIG_JSONC */

#define OPT_VALS(n) \
struct argconfig_opt_val n[]

Expand Down
Loading