groovy
  1. groovy
  2. GROOVY-3043

Command line arguments containing * (asterisk) not passed correctly

    Details

    • Number of attachments :
      2

      Description

      Groovy does weird things with command line arguments containing *. Makes it very difficult to pass in things like file specs, ant specs and regex expresssions!!! A simple program that prints out the length of the args parameter passed into main procedure - a few are correct but most are wrong:

      >groovy fail test
      args length: 1
      
      >groovy fail *
      args length: 3
      
      >groovy fail **
      args length: 0
      
      >groovy fail "**"
      args length: 0
      
      >groovy fail "test"  " *"
      args length: 2
      
      >groovy fail "test"  "*"
      args length: 1
      
      >groovy fail "test   *"
      args length: 1
      
      >groovy fail "*test*"
      args length: 0
      
      >groovy fail "*test*"
      args length: 0
      
      >groovy fail " *test*"
      args length: 1
      
      1. startGroovy_V1.bat
        7 kB
        Herbert Gerhards
      2. startGroovy_V2.bat
        5 kB
        Herbert Gerhards

        Activity

        Hide
        Paul King added a comment -

        I believe the issue was fixed at the time but has since been broken. Unfortunately, we don't have a good test suite around our windows bat files or unix shell scripts. We certainly need to improve that. Also, I believe there are subsequent issues been raised against command line anomalies but if you have a particular specific easily reproducible example that needs fixing, feel free to raise an Jira. And feel free to attach patches/tests too if you can!

        Show
        Paul King added a comment - I believe the issue was fixed at the time but has since been broken. Unfortunately, we don't have a good test suite around our windows bat files or unix shell scripts. We certainly need to improve that. Also, I believe there are subsequent issues been raised against command line anomalies but if you have a particular specific easily reproducible example that needs fixing, feel free to raise an Jira. And feel free to attach patches/tests too if you can!
        Hide
        Bob Swift added a comment -

        I have a GINT test for this at https://bitbucket.org/bob_swift/gint/src/6ef31d170cdd/src/itest/groovy/javaTest2.gant. It showed almost all cases fixed on 1.7.x. I haven't installed 1.8 yet to see if it has regressed.

        Show
        Bob Swift added a comment - I have a GINT test for this at https://bitbucket.org/bob_swift/gint/src/6ef31d170cdd/src/itest/groovy/javaTest2.gant . It showed almost all cases fixed on 1.7.x. I haven't installed 1.8 yet to see if it has regressed.
        Hide
        Paul King added a comment -

        Cool Bob. This gives me an excuse to use GINT a little more. I don't think anything regressed in that area in the move to 1.8 but I think there was a small regression or two quite some time back (but after this issue was closed) which we haven't got around to fixing yet for fear of making things worse. Perhaps a GINT test suite would help us refactor and fix things with more confidence.

        Show
        Paul King added a comment - Cool Bob. This gives me an excuse to use GINT a little more. I don't think anything regressed in that area in the move to 1.8 but I think there was a small regression or two quite some time back (but after this issue was closed) which we haven't got around to fixing yet for fear of making things worse. Perhaps a GINT test suite would help us refactor and fix things with more confidence.
        Hide
        Bob Swift added a comment -

        I can help with the testing, but got a backlog of other things at the moment. Hope to run GINT integration test on 1.8 soon and that will show any regression for this issue.

        Show
        Bob Swift added a comment - I can help with the testing, but got a backlog of other things at the moment. Hope to run GINT integration test on 1.8 soon and that will show any regression for this issue.
        Hide
        Bob Swift added a comment -

        Oops, meant to reference the groovy test, not the java test:
        https://bitbucket.org/bob_swift/gint/src/6ef31d170cdd/src/itest/groovy/groovyTest2.gant
        Unfortunately, I don't have authority to edit my own comment .

        Show
        Bob Swift added a comment - Oops, meant to reference the groovy test, not the java test: https://bitbucket.org/bob_swift/gint/src/6ef31d170cdd/src/itest/groovy/groovyTest2.gant Unfortunately, I don't have authority to edit my own comment .

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Bob Swift
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: