dev@glassfish.java.net

Re: V3: Has the asadmin deploy command changed w.r.t specifying the context root

From: Vince Kraemer <Vince.Kraemer_at_Sun.COM>
Date: Tue, 12 Feb 2008 16:50:32 -0800

This is starting to sound like the discussion that we had some time back
about something similar to the 'Did you mean: x y z?" feature that
Google has...

See https://glassfish.dev.java.net/servlets/ReadMsg?listName=dev&msgNo=1660.

This lead to the great work that Jane did with CLI back in V2:
http://blogs.sun.com/janeyoung/entry/finding_cli_commands_in_glassfish

Now it is time to take the next step... What is an example of the next
step... See http://userscripts.org/scripts/show/9514

vbk

Other notes in-line...

Kedar Mhaswade wrote:
>
>
> Jerome Dochez wrote:
>> I was talking to Jane about this yesterday, We need to ensure we are
>> satisfying the CLIP requirements but that's definitely my feeling too,
>>
>> just like if someone types --contxetroot, we should interpret it as
>> --contextroot...
>
>
> Hmm. That's interesting but difficult to get right and has implications
> on "interface" definition and compatibility.
> Maybe someone did want to get an error back
> on typo? (Otherwise we might have to support all the typos forever!)

we might not support typos in scripts... but we want to try to make it
easy for the user to keep working....

Our CLI is currently like Google search, but we force the user to retype
the query... instead of click the "did you mean" link....

let's extend the example from jane's blog entry...

USER> asadmin create-domian --adminport 4848 --user admin foo

current return text>* **Closest matched command(s):
            create-domain*
          Use "help" command for a list of valid commands.

proposed return text> *Closest matched command(s):
            create-domain*
          Use "help" command for a list of valid commands.
          Execute "asadmin create-domain --adminport 4848 --user admin foo"?


If the user enters y/yes/true... the proposed command would be executed.

In cases where there are multiple choices of the most likely correct
choice, the Execute part of the return text would not appear.

I realize that this isn't "clean" from a defined interface
perspective... but, humans aren't "clean" from a defined interface
perspective, either.

This is the kind of feature that can delight a user when they discover it...

>
> Case-sensitivity is slightly different. For a long option, a "correct"
> spelling in any case could be accepted as valid without huge (as in
> difficult to deal with) implications.
>
> Incidentally, I think we need to consider the exit codes from CLI with
> some seriousness. I have started a discussion topic at:
> http://wiki.glassfish.java.net/Wiki.jsp?page=ProsAndConsOfAsadminExitCodes
>
> and will be adding content to it soon. A reasonable exit code (and
> message)
> would indicate the typo like: "Did you mean --contextroot instead"? would
> lead to better overall user experience.

I agree. But we can go even higher then that...
>
> Regards,
> Kedar
>