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

Can't pass negative arguments to script (because of the minus sign)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-6
    • 1.0-beta-7
    • None
    • Windows 2000

    Description

      1. Create this groovy script and name it "x.groovy":

      print args[0]

      2. Execute this command:

      groovy x.groovy -5 7

      We expect "-5" to be printed, but "7" is printed. I guess groovy is treating -5 as an argument to groovy. But it comes after the script filename.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jaquino Jonathan Aquino
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: