dev@glassfish.java.net

Re: "Did you mean" in asadmin

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Fri, 11 Aug 2006 11:44:01 -0700

Kohsuke Kawaguchi wrote:
> Kedar Mhaswade wrote:
>> Also, if someone intended to execute "foolish"
>> command, I am not sure if s/he would "mistype" it like "foo".
>> A typo is generally having not more than 2 characters of
>> "Hamming distance" away from the correctly spelled word. (The
>> sequence is important too).
>
> Yes.
>
>> This is rather different (although related to) from the
>> "keyword" search where I am trying to search for a command, which
>> is also a useful addition.
>
> Right. It definitely needs a different algorithm for sure. Edit distance
> from "database" to "start-database" is 6, and that's a lot.
>
OK. So we will review/use/possibly enhance method suggested by you
(go CDDL!) and have two things integrated into asadmin:
- Response to Cheng's need of helping find out mistyped command names.
- Keyword search of commands. An attempt will be made to find out
   the "intent" of the user.

We are going to limit this to finding the names of the "commands"
only. I guess we should not attempt option names just yet.
This gels in well with the "prompting for required options and
operands" (when you know that a human is present to respond)
[http://wiki.java.net/bin/view/Projects/HighLevelAdminFeaturesForGlassFishV2#c9]
so that either values will be prompted for, or defaults will
prevail.

For example, I think

asadmin create-domain

admin-port[4849]: (enter)
admin-user[admin]: (enter)
admin-password: (enter)
admin-password: (enter)
domain-name [name]: dfdfdf

is much better than:

asadmin create-domain

->command failed, run it with admin user, admin
pasword file, domain name etc.

Kedar