diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-29 16:32:06 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-30 16:29:34 -0800 |
commit | 5dd6457d2c06caed01d4b75ecf1415afc68b48ea (patch) | |
tree | be71632393f3c68859d733be7bbd842b1c9572d6 | |
parent | 3d204ec66a840849372ab4c0ec4526a6f8557106 (diff) | |
download | riscv-openocd-5dd6457d2c06caed01d4b75ecf1415afc68b48ea.zip riscv-openocd-5dd6457d2c06caed01d4b75ecf1415afc68b48ea.tar.gz riscv-openocd-5dd6457d2c06caed01d4b75ecf1415afc68b48ea.tar.bz2 |
make syntax errors respond with 'usage'
The 'help' text will become more verbose, so its entire text will be
far more than desired when you only borked your syntax. The usage
still allows the commands to be looked up for more help.
-rw-r--r-- | src/helper/command.c | 6 | ||||
-rw-r--r-- | src/helper/startup.tcl | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index 6031ce6..319f081 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -562,7 +562,7 @@ static int run_command(struct command_context *context, /* Print help for command */ char *full_name = command_name(c, ' '); if (NULL != full_name) { - command_run_linef(context, "help %s", full_name); + command_run_linef(context, "usage %s", full_name); free(full_name); } else retval = -ENOMEM; @@ -980,10 +980,10 @@ static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } else { - c = command_find(cmd_ctx->commands, "help"); + c = command_find(cmd_ctx->commands, "usage"); if (NULL == c) { - LOG_ERROR("unknown command, but help is missing too"); + LOG_ERROR("unknown command, but usage is missing too"); return JIM_ERR; } count = argc - remaining; diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index dda89c8..d1c73ef 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -25,7 +25,7 @@ proc ocd_bouncer {name args} { set errmsg "Command handler execution failed" } } else {if {$type == "group"} { - catch {eval ocd_help $name $args} + catch {eval ocd_usage $name $args} set errmsg [format "%s: command requires more arguments" \ [concat $name " " $args]] } else { |