Commit 57962f4d authored by Antonio Borneo's avatar Antonio Borneo Committed by Tomas Vanek
Browse files

command_registration: add empty usage field to chained commands



Chained command require a subcommand as first argument. The usage
field for chained commands is not really important because the
"help" command will list all the subcommands with their respective
usage.

Add a empty usage field on all chained command.
The command "jlink config" can be either followed by a subcommand
or used alone, so use a dedicated usage string.

Change-Id: I43c3f8a766f96a9bdab4e709e3c90713be41fcef
Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5017


Tested-by: jenkins
Reviewed-by: default avatarTomas Vanek <vanekt@fbl.cz>
parent a5a882c5
...@@ -193,7 +193,8 @@ static const struct command_registration mxc_nand_command_handler[] = { ...@@ -193,7 +193,8 @@ static const struct command_registration mxc_nand_command_handler[] = {
.name = "mxc", .name = "mxc",
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "MXC NAND flash controller commands", .help = "MXC NAND flash controller commands",
.chain = mxc_sub_command_handlers .chain = mxc_sub_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -109,6 +109,7 @@ static const struct command_registration faux_command_handlers[] = { ...@@ -109,6 +109,7 @@ static const struct command_registration faux_command_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "faux flash command group", .help = "faux flash command group",
.chain = hello_command_handlers, .chain = hello_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -977,6 +977,7 @@ static const struct command_registration max32xxx_command_handlers[] = { ...@@ -977,6 +977,7 @@ static const struct command_registration max32xxx_command_handlers[] = {
.mode = COMMAND_EXEC, .mode = COMMAND_EXEC,
.help = "max32xxx flash command group", .help = "max32xxx flash command group",
.chain = max32xxx_exec_command_handlers, .chain = max32xxx_exec_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -1260,6 +1260,7 @@ static const struct command_registration flash_command_handlers[] = { ...@@ -1260,6 +1260,7 @@ static const struct command_registration flash_command_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "NOR flash command group", .help = "NOR flash command group",
.chain = flash_config_command_handlers, .chain = flash_config_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -105,8 +105,8 @@ const struct command_registration hello_command_handlers[] = { ...@@ -105,8 +105,8 @@ const struct command_registration hello_command_handlers[] = {
.name = "foo", .name = "foo",
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "example command handler skeleton", .help = "example command handler skeleton",
.chain = foo_command_handlers, .chain = foo_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
...@@ -1294,6 +1294,7 @@ static const struct command_registration command_builtin_handlers[] = { ...@@ -1294,6 +1294,7 @@ static const struct command_registration command_builtin_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "core command group (introspection)", .help = "core command group (introspection)",
.chain = command_subcommand_handlers, .chain = command_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -136,8 +136,8 @@ static const struct command_registration dummy_command_handlers[] = { ...@@ -136,8 +136,8 @@ static const struct command_registration dummy_command_handlers[] = {
.name = "dummy", .name = "dummy",
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "dummy interface driver commands", .help = "dummy interface driver commands",
.chain = hello_command_handlers, .chain = hello_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE, COMMAND_REGISTRATION_DONE,
}; };
......
...@@ -1849,12 +1849,14 @@ static const struct command_registration jlink_subcommand_handlers[] = { ...@@ -1849,12 +1849,14 @@ static const struct command_registration jlink_subcommand_handlers[] = {
.help = "access the device configuration. If no argument is given " .help = "access the device configuration. If no argument is given "
"this will show the device configuration", "this will show the device configuration",
.chain = jlink_config_subcommand_handlers, .chain = jlink_config_subcommand_handlers,
.usage = "[<cmd>]",
}, },
{ {
.name = "emucom", .name = "emucom",
.mode = COMMAND_EXEC, .mode = COMMAND_EXEC,
.help = "access EMUCOM channel", .help = "access EMUCOM channel",
.chain = jlink_emucom_subcommand_handlers .chain = jlink_emucom_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
...@@ -1865,6 +1867,7 @@ static const struct command_registration jlink_command_handlers[] = { ...@@ -1865,6 +1867,7 @@ static const struct command_registration jlink_command_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "perform jlink management", .help = "perform jlink management",
.chain = jlink_subcommand_handlers, .chain = jlink_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -576,6 +576,7 @@ static const struct command_registration cti_command_handlers[] = { ...@@ -576,6 +576,7 @@ static const struct command_registration cti_command_handlers[] = {
.mode = COMMAND_CONFIG, .mode = COMMAND_CONFIG,
.help = "CTI commands", .help = "CTI commands",
.chain = cti_subcommand_handlers, .chain = cti_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -373,6 +373,7 @@ static const struct command_registration dap_commands[] = { ...@@ -373,6 +373,7 @@ static const struct command_registration dap_commands[] = {
.mode = COMMAND_CONFIG, .mode = COMMAND_CONFIG,
.help = "DAP commands", .help = "DAP commands",
.chain = dap_subcommand_handlers, .chain = dap_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -441,6 +441,7 @@ static const struct command_registration etb_command_handlers[] = { ...@@ -441,6 +441,7 @@ static const struct command_registration etb_command_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "Embedded Trace Buffer command group", .help = "Embedded Trace Buffer command group",
.chain = etb_config_command_handlers, .chain = etb_config_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -66,6 +66,7 @@ static const struct command_registration etm_dummy_command_handlers[] = { ...@@ -66,6 +66,7 @@ static const struct command_registration etm_dummy_command_handlers[] = {
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "Dummy ETM capture driver command group", .help = "Dummy ETM capture driver command group",
.chain = etm_dummy_config_command_handlers, .chain = etm_dummy_config_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -6096,8 +6096,8 @@ static const struct command_registration target_command_handlers[] = { ...@@ -6096,8 +6096,8 @@ static const struct command_registration target_command_handlers[] = {
.name = "target", .name = "target",
.mode = COMMAND_CONFIG, .mode = COMMAND_CONFIG,
.help = "configure target", .help = "configure target",
.chain = target_subcommand_handlers, .chain = target_subcommand_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
...@@ -30,8 +30,8 @@ static const struct command_registration testee_command_handlers[] = { ...@@ -30,8 +30,8 @@ static const struct command_registration testee_command_handlers[] = {
.name = "testee", .name = "testee",
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
.help = "testee target commands", .help = "testee target commands",
.chain = hello_command_handlers, .chain = hello_command_handlers,
.usage = "",
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment