Commit e25d6970 authored by shemminger's avatar shemminger

Backout ambigious error for ip

parent ede72396
2005-12-02 Stephen Hemminger <shemminger@osdl.org
* Backout ambigious ip command matches
2005-11-22 Stephen Hemminger <shemminger@osdl.org
* Handle ambigious ip command matches
......
......@@ -80,23 +80,13 @@ static const struct cmd {
static int do_cmd(const char *argv0, int argc, char **argv)
{
const struct cmd *c, *m = NULL;
const struct cmd *c;
for (c = cmds; c->cmd; ++c) {
if (matches(argv0, c->cmd) == 0) {
if (m && m->func != c->func) {
fprintf(stderr,
"Ambiguious command \"%s\" matches both %s and %s\n",
argv0, m->cmd, c->cmd);
return -1;
}
m = c;
}
if (matches(argv0, c->cmd) == 0)
return c->func(argc-1, argv+1);
}
if (m)
return m->func(argc-1, argv+1);
fprintf(stderr, "Object \"%s\" is unknown, try \"ip help\".\n", argv0);
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment