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: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5017
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo
2019-01-04 15:13:53 +01:00
committed by Tomas Vanek
parent a5a882c5c8
commit 57962f4d1c
14 changed files with 18 additions and 6 deletions

View File

@@ -136,8 +136,8 @@ static const struct command_registration dummy_command_handlers[] = {
.name = "dummy",
.mode = COMMAND_ANY,
.help = "dummy interface driver commands",
.chain = hello_command_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE,
};

View File

@@ -1849,12 +1849,14 @@ static const struct command_registration jlink_subcommand_handlers[] = {
.help = "access the device configuration. If no argument is given "
"this will show the device configuration",
.chain = jlink_config_subcommand_handlers,
.usage = "[<cmd>]",
},
{
.name = "emucom",
.mode = COMMAND_EXEC,
.help = "access EMUCOM channel",
.chain = jlink_emucom_subcommand_handlers
.chain = jlink_emucom_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
};
@@ -1865,6 +1867,7 @@ static const struct command_registration jlink_command_handlers[] = {
.mode = COMMAND_ANY,
.help = "perform jlink management",
.chain = jlink_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
};