w1: shell: adopt SHELL_HELP

have w1 shell commands use the new SHELL_HELP macro

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé 2025-06-04 23:03:51 +02:00 committed by Benjamin Cabé
commit b84294c156

View file

@ -370,43 +370,41 @@ static int cmd_w1_search(const struct shell *sh, size_t argc, char **argv)
SHELL_STATIC_SUBCMD_SET_CREATE(sub_w1, SHELL_STATIC_SUBCMD_SET_CREATE(sub_w1,
SHELL_CMD_ARG(reset, NULL, SHELL_CMD_ARG(reset, NULL,
"Reset 1-Wire bus.\n" SHELL_HELP("Reset 1-Wire bus",
"Usage: <device>", "<device>"),
cmd_w1_reset_bus, 2, 0), cmd_w1_reset_bus, 2, 0),
SHELL_CMD_ARG(read_bit, NULL, SHELL_CMD_ARG(read_bit, NULL,
"Read 1-Wire bit.\n" SHELL_HELP("Read 1-Wire bit",
"Usage: <device>", "<device>"),
cmd_w1_read_bit, 2, 0), cmd_w1_read_bit, 2, 0),
SHELL_CMD_ARG(read_byte, NULL, SHELL_CMD_ARG(read_byte, NULL,
"Read 1-Wire byte.\n" SHELL_HELP("Read 1-Wire byte",
"Usage: <device>", "<device>"),
cmd_w1_read_byte, 2, 0), cmd_w1_read_byte, 2, 0),
SHELL_CMD_ARG(read_block, NULL, SHELL_CMD_ARG(read_block, NULL,
"Read 1-Wire block.\n" SHELL_HELP("Read 1-Wire block",
"Usage: <device> <num_bytes>", "<device> <num_bytes>"),
cmd_w1_read_block, 3, 0), cmd_w1_read_block, 3, 0),
SHELL_CMD_ARG(write_bit, NULL, SHELL_CMD_ARG(write_bit, NULL,
"Write 1-Wire bit.\n" SHELL_HELP("Write 1-Wire bit",
"Usage: <device> <bit>", "<device> <bit>"),
cmd_w1_write_bit, 3, 0), cmd_w1_write_bit, 3, 0),
SHELL_CMD_ARG(write_byte, NULL, SHELL_CMD_ARG(write_byte, NULL,
"Write 1-Wire byte.\n" SHELL_HELP("Write 1-Wire byte",
"Usage: <device> [-r] <byte>\n" "<device> [-r] <byte>"),
OPTION_HELP_RESET,
cmd_w1_write_byte, 3, 1), cmd_w1_write_byte, 3, 1),
SHELL_CMD_ARG(write_block, NULL, SHELL_CMD_ARG(write_block, NULL,
"Write 1-Wire block.\n" SHELL_HELP("Write 1-Wire block",
"Usage: <device> [-r] <byte1> [<byte2>, ...]\n" "<device> [-r] <byte1> [<byte2>, ...]"),
OPTION_HELP_RESET,
cmd_w1_write_block, 3, BUF_SIZE), cmd_w1_write_block, 3, BUF_SIZE),
SHELL_CMD_ARG(config, NULL, SHELL_CMD_ARG(config, NULL,
"Configure 1-Wire host.\n" SHELL_HELP("Configure 1-Wire host",
"Usage: <device> <type> <value>\n" "<device> <type> <value>\n"
"<type> is either a name or an id.", "<type> is either a name or an id."),
cmd_w1_configure, 4, 0), cmd_w1_configure, 4, 0),
SHELL_CMD_ARG(search, NULL, SHELL_CMD_ARG(search, NULL,
"1-Wire devices.\n" SHELL_HELP("Search 1-Wire devices on bus",
"Usage: <device>", "<device>"),
cmd_w1_search, 2, 0), cmd_w1_search, 2, 0),
SHELL_SUBCMD_SET_END /* Array terminated. */ SHELL_SUBCMD_SET_END /* Array terminated. */
); );