Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-4636

Groovy CLI fails when trying to read from stdin

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cli
    • None
    • Platform: All, OS: All

      When trying to send groovy scripts to stdin for the groovy CLI, it fails with

      "-" is not a valid option

          [JENKINS-4636] Groovy CLI fails when trying to read from stdin

          I guess args4j does not handle just - as an option, so I have changed - to =. Not sure whether that is the
          best choice, but it works.

          Also I needed to change the name of the class to something static and not the name of the input, as "-"
          does not make for a good groovy class name. Neither does some-script.groovy.

          Stig Kleppe-Jørgensen added a comment - I guess args4j does not handle just - as an option, so I have changed - to =. Not sure whether that is the best choice, but it works. Also I needed to change the name of the class to something static and not the name of the input, as "-" does not make for a good groovy class name. Neither does some-script.groovy.

          dvrzalik added a comment -

          Wrong subcomponent?

          dvrzalik added a comment - Wrong subcomponent?

          Duh...yes, of course it is cli.

          Stig Kleppe-Jørgensen added a comment - Duh...yes, of course it is cli.

          Created an attachment (id=945)
          Change - to = as the option for stdin and use "RemoteClass" as the script's class name

          Stig Kleppe-Jørgensen added a comment - Created an attachment (id=945) Change - to = as the option for stdin and use "RemoteClass" as the script's class name

          Fix committed on revision 23228.

          Stig Kleppe-Jørgensen added a comment - Fix committed on revision 23228.

            Unassigned Unassigned
            stigkj Stig Kleppe-Jørgensen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: