You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Teebs Puig (Jira)" <ji...@apache.org> on 2020/04/01 07:29:00 UTC

[jira] [Created] (GROOVY-9496) Register a new command with the shell Not Working (:rc)

Teebs Puig created GROOVY-9496:
----------------------------------

             Summary: Register a new command with the shell Not Working (:rc)
                 Key: GROOVY-9496
                 URL: https://issues.apache.org/jira/browse/GROOVY-9496
             Project: Groovy
          Issue Type: Bug
          Components: command line processing, Groovy Console
    Affects Versions: 3.0.2, 3.0.1
         Environment: Linux Xubunto
            Reporter: Teebs Puig


loading a CommandSupport or ComplexCommandSupport class using (:rc) is not working

i.e.

 
{code:java}

class TestCommand extends CommandSupport {    
    TestCommand(final Groovysh shell) {
        super(shell, ':commando', ':cc')
    }
    @Override
    Object execute(final List<String> args) {
        assertNoArguments(args)       
        io.out.println('@|red clear|@')
    }
}{code}
 

 

using groovysh, :rc TestCommand
{noformat}
ERROR groovy.lang.GroovyRuntimeException:
Could not find matching constructor for: TestCommand(org.apache.groovy.groovysh.Groovysh)
        at org.apache.groovy.groovysh.commands.RegisterCommand.execute (RegisterCommand.groovy:52)
        at org.apache.groovy.groovysh.Command$execute.call (Unknown Source)
        at org.apache.groovy.groovysh.Command$execute.call (Unknown Source)
        at org.apache.groovy.groovysh.Shell.execute (Shell.groovy:103)
        at org.apache.groovy.groovysh.Groovysh.super$2$execute (Groovysh.groovy)
        at org.apache.groovy.groovysh.Groovysh.executeCommand (Groovysh.groovy:308)
        at org.apache.groovy.groovysh.Groovysh.execute (Groovysh.groovy:171)
        at org.apache.groovy.groovysh.Shell.leftShift (Shell.groovy:121)
        at org.apache.groovy.groovysh.Shell$leftShift$0.call (Unknown Source)
        at org.apache.groovy.groovysh.ShellRunner.work (ShellRunner.groovy:93)
        at org.apache.groovy.groovysh.InteractiveShellRunner.super$2$work (InteractiveShellRunner.groovy)
        at org.apache.groovy.groovysh.InteractiveShellRunner.work (InteractiveShellRunner.groovy:157)
        at org.apache.groovy.groovysh.ShellRunner.run (ShellRunner.groovy:57)
        at org.apache.groovy.groovysh.InteractiveShellRunner.super$2$run (InteractiveShellRunner.groovy)
        at org.apache.groovy.groovysh.InteractiveShellRunner.run (InteractiveShellRunner.groovy:116)
        at java_lang_Runnable$run.call (Unknown Source)
        at org.apache.groovy.groovysh.Groovysh.run (Groovysh.groovy:653)
        at org.apache.groovy.groovysh.Groovysh$run$0.callCurrent (Unknown Source)
        at org.apache.groovy.groovysh.Groovysh.run (Groovysh.groovy:618)
        at org.apache.groovy.groovysh.Groovysh$run.call (Unknown Source)
        at org.apache.groovy.groovysh.Main.startGroovysh (Main.groovy:190)
        at org.apache.groovy.groovysh.Main.main (Main.groovy:156)
{noformat}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)