X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fopenocd.c;h=d67ebd59b176273a1be992ef3b6e3a38da08120e;hb=a043632a529c0b98bb8771c8815e7681e4ed0f12;hp=8fa40f06a5202aeecb4b12115c4a676ede24f1b1;hpb=dc575dc5bf8cb597a0e9a47794744ae6b1928087;p=openocd.git diff --git a/src/openocd.c b/src/openocd.c index 8fa40f06a5..d67ebd59b1 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * * * - * Copyright (C) 2007,2008 Øyvind Harboe * + * Copyright (C) 2007,2008 Øyvind Harboe * * oyvind.harboe@zylin.com * * * * Copyright (C) 2008 Richard Missenden * @@ -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); @@ -253,10 +257,13 @@ int openocd_main(int argc, char *argv[]) } #endif - LOG_OUTPUT("\n\nBUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS\n\n\n"); - print_version(); + LOG_OUTPUT("For bug reports, read\n\t" + "http://openocd.berlios.de/doc/doxygen/bugs.html" + "\n"); + + command_context_mode(cmd_ctx, COMMAND_CONFIG); command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);