Cheng Fang wrote:
> We can have some simple pattern match to map wrong subcommands to a list
> of valid commands. Any interest?
A better approach is to compute the string edit distance to the nearest
available command. This works pretty well for simple typos, and I've
been using it successfully in the JAXB RI to diagnose user's typos:
public static String findNearest( String key, String[] group ) {
...
}
It finds the string in "group" that's closest to the given key.
The code is under CDDL, and if Glassfish developers would like to copy
it, I'd be very happy.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com