add src/hello.c to augment new command tutorial
[openocd.git] / src / openocd.c
index 95c2f237db33bc4a05d43200f00d9badb67096a1..d67ebd59b176273a1be992ef3b6e3a38da08120e 100644 (file)
@@ -49,7 +49,7 @@
 
 
 #define OPENOCD_VERSION \
-               "Open On-Chip Debugger " VERSION " (" PKGBLDDATE ") " RELSTR PKGBLDREV
+               "Open On-Chip Debugger " VERSION RELSTR " (" PKGBLDDATE ")"
 
 static void print_version(void)
 {
@@ -67,7 +67,7 @@ static void print_version(void)
 }
 
 /* Give TELNET a way to find out what version this is */
-static int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_version_command)
 {
        if (argc != 0)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -109,7 +109,7 @@ static int log_target_callback_event_handler(struct target_s *target, enum targe
 int ioutil_init(struct command_context_s *cmd_ctx);
 
 /* OpenOCD can't really handle failure of this command. Patches welcome! :-) */
-static int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_init_command)
 {
 
        if (argc != 0)
@@ -177,6 +177,9 @@ static int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
 command_context_t *global_cmd_ctx;
 
+/// src/hello.c gives a simple example for writing new command modules
+int hello_register_commands(struct command_context_s *cmd_ctx);
+
 /* NB! this fn can be invoked outside this file for non PC hosted builds */
 command_context_t *setup_command_handler(void)
 {
@@ -188,6 +191,7 @@ command_context_t *setup_command_handler(void)
                                         COMMAND_EXEC, "show OpenOCD version");
 
        /* register subsystem commands */
+       hello_register_commands(cmd_ctx);
        server_register_commands(cmd_ctx);
        telnet_register_commands(cmd_ctx);
        gdb_register_commands(cmd_ctx);
@@ -255,7 +259,9 @@ int openocd_main(int argc, char *argv[])
 
        print_version();
 
-       LOG_OUTPUT("For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS\n");
+       LOG_OUTPUT("For bug reports, read\n\t"
+               "http://openocd.berlios.de/doc/doxygen/bugs.html"
+               "\n");
 
 
        command_context_mode(cmd_ctx, COMMAND_CONFIG);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)