groovy
  1. groovy
  2. GROOVY-3084

Groovy scripts can't access the 'args' property anymore to get the arguments from the command line

    Details

    • Number of attachments :
      2

      Description

      macpro:~ sam$ cat /tmp/test.groovy
      println args

      macpro:~ sam$ ~/Software/groovy-1.6-beta-2/bin/groovy /tmp/test.groovy
      Caught: groovy.lang.MissingPropertyException: No such property: args for class: test
      at test.run(test.groovy:1)

      The exact same thing will work on any previous version of groovy.

      1. Groovy3084Patch.txt
        0.5 kB
        Roshan Dawrani
      2. Test3084.groovy
        0.2 kB
        Roshan Dawrani

        Activity

        Hide
        Robert O'Connor added a comment -

        I can confirm this worked on 1.6-beta1 so he's not the only one

        Show
        Robert O'Connor added a comment - I can confirm this worked on 1.6-beta1 so he's not the only one
        Hide
        Russel Winder added a comment -

        The bug was introduced into Groovy between 2008-08-14 and 2008-09-28. The detector here is the native launcher Buildbot. Antti and I raised this but it was not picked up. It is probably my fault for thinking that it might have been something to do with the Commons CLI-2 experimentation I was doing at the time.

        In a sense I am glad it is just a Groovy error.

        Fix this, fix the native laucher integration test failures!

        Show
        Russel Winder added a comment - The bug was introduced into Groovy between 2008-08-14 and 2008-09-28. The detector here is the native launcher Buildbot. Antti and I raised this but it was not picked up. It is probably my fault for thinking that it might have been something to do with the Commons CLI-2 experimentation I was doing at the time. In a sense I am glad it is just a Groovy error. Fix this, fix the native laucher integration test failures!
        Hide
        Roshan Dawrani added a comment -

        Hi,
        The attached patch worked for me on 1.6beta2 code. The command line arguments now get passed to the script's binding as variable "args".
        Regards,
        Roshan

        Show
        Roshan Dawrani added a comment - Hi, The attached patch worked for me on 1.6beta2 code. The command line arguments now get passed to the script's binding as variable "args". Regards, Roshan
        Hide
        Roshan Dawrani added a comment -

        Submitting a test case. It goes through after applying the patch I previously submitted.

        rgds,
        Roshan

        Show
        Roshan Dawrani added a comment - Submitting a test case. It goes through after applying the patch I previously submitted. rgds, Roshan
        Hide
        Paul King added a comment -

        Fixed. Thanks for the issue and patch.

        Show
        Paul King added a comment - Fixed. Thanks for the issue and patch.

          People

          • Assignee:
            Paul King
            Reporter:
            Sam Pullara
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: