]> git.sur5r.net Git - openocd/commitdiff
jlink: switch commands to subcommands
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Mon, 28 Feb 2011 19:40:46 +0000 (20:40 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 2 Mar 2011 18:04:00 +0000 (19:04 +0100)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
doc/openocd.texi
src/jtag/drivers/jlink.c

index 7772d788b1abea5dd806bed634ccd5036b27ad0d..5b123860d3cd0aa17cda38db7df033d6d77464ab 100644 (file)
@@ -2319,9 +2319,9 @@ This is a write-once setting.
 
 @deffn {Interface Driver} {jlink}
 Segger jlink USB adapter
-@c command:    jlink_info
+@c command:    jlink info
 @c     dumps status
-@c command:    jlink_hw_jtag (2|3)
+@c command:    jlink hw_jtag (2|3)
 @c     sets version 2 or 3
 @end deffn
 
index b182b6149caa3c2240177e4ac19d16651853b286..8a2c5ab3c9f15c6ebfb9ead1a292a0bf4c254889 100644 (file)
@@ -656,15 +656,15 @@ COMMAND_HANDLER(jlink_handle_jlink_hw_jtag_command)
        return ERROR_OK;
 }
 
-static const struct command_registration jlink_command_handlers[] = {
+static const struct command_registration jlink_subcommand_handlers[] = {
        {
-               .name = "jlink_info",
+               .name = "info",
                .handler = &jlink_handle_jlink_info_command,
                .mode = COMMAND_EXEC,
                .help = "show jlink info",
        },
        {
-               .name = "jlink_hw_jtag",
+               .name = "hw_jtag",
                .handler = &jlink_handle_jlink_hw_jtag_command,
                .mode = COMMAND_EXEC,
                .help = "access J-Link HW JTAG command version",
@@ -673,6 +673,16 @@ static const struct command_registration jlink_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration jlink_command_handlers[] = {
+       {
+               .name = "jlink",
+               .mode = COMMAND_ANY,
+               .help = "perform jlink management",
+               .chain = jlink_subcommand_handlers,
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 struct jtag_interface jlink_interface = {
        .name = "jlink",
        .commands = jlink_command_handlers,