Strappazzon | 16 May 15:12
Picon

Re: [groovy-user] Customizing GroovySh

Guillaume Laforge a écrit :
> Hi Benjamin,
>
> On Fri, May 16, 2008 at 2:19 PM, Strappazzon
> <benjamin.strappazzon@...> wrote:
>   
>> I currently work on a project that aims to develop a shell.
>> I use groovySh as a base and add my own command.
>>     
>
> Excellent!
> In Groovy 1.6-beta-1, I think it's now easier to register your own commands.
> Have you used that mechanism?
> Which version do you use?
>   
I use groovy 1.5.6 and create a class that implements 
org.codehaus.groovy.tools.shell.Command
then I construct a groovysh instance and register my command in it.
Everything works very well, I can execute my command and it appears on 
the help.

However I'm going to try groovy 1.6-beta-1 if it is even easier.
||
>   
>> I already succeed in adding commands in groovysh but, now
>> what I'd like to do is to customize the prompt and the banner message.
>> I tried to extends GroovySh to provide my own prompt but the the method that
>> define it is private.
>> Is there another solution to customize the prompt and the banner without
>> modifying groovy source code.
>>     
>
> Currently, if the method is private, you obviously can't override it.
> But if you create a JIRA issue with such a request for improvement,
> it's an easy fix if it's just making the method public!
>
>   
Thank you, I'm going to create the JIRA issue

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane