You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by cyprushelp <cy...@gmail.com> on 2016/02/05 03:13:50 UTC

Groovysh in non-interactive mode

Hello,

Groovysh no longer works in non-interactive mode.

1) Before Groovy 2.4, you could run groovysh in non-interactive mode. It
would execute the action and then quit. This made it useful when embedding
in shell scripts etc.
2) Before Groovy 2.4, you could pass arguments to groovysh in
non-interactive mode. For example, I had some custom commands which I could
execute not only from within the shell, but also outside of the shell.

Both these features seem to be gone in latest Groovy 2.4.5 release. They
were useful and a lot of code depended on them. I wonder if someone has any
workarounds. I am not sure if the changes in
https://issues.apache.org/jira/browse/GROOVY-6754 caused this.

Before (groovy 2.3.9):
user@machine:~$ groovysh :show all
No variables defined
No classes have been loaded
No custom imports have been defined
Preferences:
    verbose=false
===> [null, null, null, null]
user@machine:~$

After (groovy 2.4.5):
user@machine:~/opt/groovy-2.4.5/bin$ ./groovysh :show all
Groovy Shell (2.4.5, JVM: 1.8.0_51)
Type ':help' or ':h' for help.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> :load :show
File not found: ":show"
groovy:000> :load all
File not found: "all"
groovy:000>

Re: Groovysh in non-interactive mode

Posted by cyprushelp <cy...@gmail.com>.
Thibault, I appreciate you getting back to me right away. I have updated
the JIRA ticket.
Jason, thank you for suggesting a workaround. Unfortunately, it will not
work for me because what I want to be executed is custom Groovysh commands.

On 5 February 2016 at 06:25, Winnebeck, Jason <
Jason.Winnebeck@windstream.com> wrote:

> Is groovy -e a solution to this problem?
>
> Jason
>
> -----Original Message-----
> From: Thibault Kruse [mailto:tibokruse@googlemail.com]
> Sent: Friday, February 05, 2016 8:57 AM
> To: users@groovy.apache.org
> Subject: Re: Groovysh in non-interactive mode
>
> Yes, the JIRA ticket you mentioned is responsible for that (so blame me
> for the change). I don't have much time to discuss this now, next week will
> be better. You might comment on your case in the JIRA ticket. It should not
> be hard to add back a non-interactive mode to the interactive shell, even
> if that sounds strange.
>
> On Fri, Feb 5, 2016 at 3:13 AM, cyprushelp <cy...@gmail.com> wrote:
> > Hello,
> >
> > Groovysh no longer works in non-interactive mode.
> >
> > 1) Before Groovy 2.4, you could run groovysh in non-interactive mode.
> > It would execute the action and then quit. This made it useful when
> > embedding in shell scripts etc.
> > 2) Before Groovy 2.4, you could pass arguments to groovysh in
> > non-interactive mode. For example, I had some custom commands which I
> > could execute not only from within the shell, but also outside of the
> shell.
> >
> > Both these features seem to be gone in latest Groovy 2.4.5 release.
> > They were useful and a lot of code depended on them. I wonder if
> > someone has any workarounds. I am not sure if the changes in
> > https://issues.apache.org/jira/browse/GROOVY-6754 caused this.
> >
> > Before (groovy 2.3.9):
> > user@machine:~$ groovysh :show all
> > No variables defined
> > No classes have been loaded
> > No custom imports have been defined
> > Preferences:
> >     verbose=false
> > ===> [null, null, null, null]
> > user@machine:~$
> >
> > After (groovy 2.4.5):
> > user@machine:~/opt/groovy-2.4.5/bin$ ./groovysh :show all Groovy Shell
> > (2.4.5, JVM: 1.8.0_51) Type ':help' or ':h' for help.
> > ----------------------------------------------------------------------
> > ----------------------------------------------------------------------
> > ----------------------------------------------------------------
> > groovy:000> :load :show
> > File not found: ":show"
> > groovy:000> :load all
> > File not found: "all"
> > groovy:000>
>
> ----------------------------------------------------------------------
> This email message and any attachments are for the sole use of the
> intended recipient(s). Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient, please
> contact the sender by reply email and destroy all copies of the original
> message and any attachments.
>

RE: Groovysh in non-interactive mode

Posted by "Winnebeck, Jason" <Ja...@windstream.com>.
Is groovy -e a solution to this problem?

Jason

-----Original Message-----
From: Thibault Kruse [mailto:tibokruse@googlemail.com] 
Sent: Friday, February 05, 2016 8:57 AM
To: users@groovy.apache.org
Subject: Re: Groovysh in non-interactive mode

Yes, the JIRA ticket you mentioned is responsible for that (so blame me for the change). I don't have much time to discuss this now, next week will be better. You might comment on your case in the JIRA ticket. It should not be hard to add back a non-interactive mode to the interactive shell, even if that sounds strange.

On Fri, Feb 5, 2016 at 3:13 AM, cyprushelp <cy...@gmail.com> wrote:
> Hello,
>
> Groovysh no longer works in non-interactive mode.
>
> 1) Before Groovy 2.4, you could run groovysh in non-interactive mode. 
> It would execute the action and then quit. This made it useful when 
> embedding in shell scripts etc.
> 2) Before Groovy 2.4, you could pass arguments to groovysh in 
> non-interactive mode. For example, I had some custom commands which I 
> could execute not only from within the shell, but also outside of the shell.
>
> Both these features seem to be gone in latest Groovy 2.4.5 release. 
> They were useful and a lot of code depended on them. I wonder if 
> someone has any workarounds. I am not sure if the changes in
> https://issues.apache.org/jira/browse/GROOVY-6754 caused this.
>
> Before (groovy 2.3.9):
> user@machine:~$ groovysh :show all
> No variables defined
> No classes have been loaded
> No custom imports have been defined
> Preferences:
>     verbose=false
> ===> [null, null, null, null]
> user@machine:~$
>
> After (groovy 2.4.5):
> user@machine:~/opt/groovy-2.4.5/bin$ ./groovysh :show all Groovy Shell 
> (2.4.5, JVM: 1.8.0_51) Type ':help' or ':h' for help.
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> ----------------------------------------------------------------
> groovy:000> :load :show
> File not found: ":show"
> groovy:000> :load all
> File not found: "all"
> groovy:000>

----------------------------------------------------------------------
This email message and any attachments are for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message and any attachments.

Re: Groovysh in non-interactive mode

Posted by Thibault Kruse <ti...@googlemail.com>.
Yes, the JIRA ticket you mentioned is responsible for that (so blame
me for the change). I don't have much time to discuss this now, next
week will be better. You might comment on your case in the JIRA
ticket. It should not be hard to add back a non-interactive mode to
the interactive shell, even if that sounds strange.

On Fri, Feb 5, 2016 at 3:13 AM, cyprushelp <cy...@gmail.com> wrote:
> Hello,
>
> Groovysh no longer works in non-interactive mode.
>
> 1) Before Groovy 2.4, you could run groovysh in non-interactive mode. It
> would execute the action and then quit. This made it useful when embedding
> in shell scripts etc.
> 2) Before Groovy 2.4, you could pass arguments to groovysh in
> non-interactive mode. For example, I had some custom commands which I could
> execute not only from within the shell, but also outside of the shell.
>
> Both these features seem to be gone in latest Groovy 2.4.5 release. They
> were useful and a lot of code depended on them. I wonder if someone has any
> workarounds. I am not sure if the changes in
> https://issues.apache.org/jira/browse/GROOVY-6754 caused this.
>
> Before (groovy 2.3.9):
> user@machine:~$ groovysh :show all
> No variables defined
> No classes have been loaded
> No custom imports have been defined
> Preferences:
>     verbose=false
> ===> [null, null, null, null]
> user@machine:~$
>
> After (groovy 2.4.5):
> user@machine:~/opt/groovy-2.4.5/bin$ ./groovysh :show all
> Groovy Shell (2.4.5, JVM: 1.8.0_51)
> Type ':help' or ':h' for help.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> groovy:000> :load :show
> File not found: ":show"
> groovy:000> :load all
> File not found: "all"
> groovy:000>