make syntax errors respond with 'usage'
authorZachary T Welch <zw@superlucidity.net>
Mon, 30 Nov 2009 00:32:06 +0000 (16:32 -0800)
committerZachary T Welch <zw@superlucidity.net>
Tue, 1 Dec 2009 00:29:34 +0000 (16:29 -0800)
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.

src/helper/command.c
src/helper/startup.tcl

index 6031ce6a4a4fdc6589d4429b565516281a725761..319f0810d6169dbfe3ec9cef67279675cd0cf749 100644 (file)
@@ -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;
index dda89c8adc6cccf09f2c427d1dff99159aae0076..d1c73ef3f2a188f1e05d91dd7393bda8f4cf94cb 100644 (file)
@@ -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 {

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)