dev@glassfish.java.net

Re: "Did you mean" in asadmin

From: vince kraemer <Vince.Kraemer_at_Sun.COM>
Date: Fri, 11 Aug 2006 11:38:49 -0700

Craig L Russell wrote:
> Hi Kohsuke,
>
> This is a great idea, perhaps you could blog about it?
>
> I think it applies to lots of different cases and needs wider
> awareness. You didn't mention what package it was in. Could it return
> a String[ ] of possible candidates ranked by nearness to the subject
> String? Then you could offer the user a choice, e.g.
>
> "Your command "foo" was not recognized. Perhaps you meant 'go-foo',
> 'foo-bar', or 'foo-lish'?"

Or, go hog wild on this....

Present a candidate string to the user to execute, instead of just
telling them to try again....

for example:

asadmin start-domain -domaindir /a/b/c myDomainName
There is no short option -d for the start-domain command.
Should I execute "start-domain --domaindir /a/b/c myDomainName", instead?

There are some obvious limits to how well this would work in the face of
multiple typos, etc....

The worst "limitation" would be making the asadmin command smart enough
to know when it was being run from a script instead of reacting to a
human actually typing commands in an interactive shell.
>
> Sweet.
>
> Craig
>