Groovy
  1. Groovy
  2. GROOVY-3084

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

    Details

      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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3d 12h 38m 1 Paul King 15/Oct/08 05:55
        Resolved Resolved Closed Closed
        69d 1h 2m 1 Paul King 23/Dec/08 05:58
        Mark Thomas made changes -
        Workflow jira [ 12969991 ] Default workflow, editable Closed status [ 12977752 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12732087 ] Default workflow, editable Closed status [ 12743921 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        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.
        Paul King made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.7 [ 14014 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Paul King made changes -
        Assignee Paul King [ paulk ]
        Roshan Dawrani made changes -
        Attachment Test3084.groovy [ 37531 ]
        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
        Roshan Dawrani made changes -
        Field Original Value New Value
        Attachment Groovy3084Patch.txt [ 37529 ]
        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
        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
        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
        Sam Pullara created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development