refactor command registration

Refactors the command registration to use helpers to simplify the code.
The unregistration routines were made more flexible by allowing them
to operate on a single command, such that one can remove all of a
commands children in one step (perhaps before adding back a 'config'
subcommand that allows getting the others back).  Eliminates a bit
of duplicated code and adds full API documentation for these routines.
This commit is contained in:
Zachary T Welch
2009-11-19 08:38:17 -08:00
parent 73c6e3bb18
commit 9e9633c6b9
3 changed files with 121 additions and 86 deletions

View File

@@ -278,7 +278,7 @@ int openocd_main(int argc, char *argv[])
httpd_stop();
#endif
unregister_all_commands(cmd_ctx);
unregister_all_commands(cmd_ctx, NULL);
/* free commandline interface */
command_done(cmd_ctx);