Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9496

Register a new command with the shell Not Working (:rc)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.1, 3.0.2
    • None
    • None
    • Linux Xubunto

    Description

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

      i.e.

       

      
      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|@')
          }
      }

       

       

      using groovysh, :rc TestCommand

      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)
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Teebs Teebs Puig
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: