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

groovy.cli.picocli.CliBuilder should behave like cli.commons.CliBuilder on invalid options

    XMLWordPrintableJSON

Details

    • Dependency upgrade
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.2
    • 2.5.3
    • None

    Description

      When stopAtNonOption: false flag is set, the two versions of CliBuilder behave differently. (See GROOVY-8740)

      The commons cli version of CliBuilder returns null:

      def optCommons = new groovy.cli.commons.CliBuilder(stopAtNonOption: false).parse(['-x'])
      if (optCommons) println "Okay" else println "Error"
      

      The picocli version of CliBuilder returns a non-null options object with the "-x" value as a positional parameter:

      def optCli = new groovy.cli.picocli.CliBuilder(stopAtNonOption: false).parse(['-x'])
      if (optCli) println "Okay" else println "Error"
      

      Attachments

        Issue Links

          Activity

            People

              rpopma Remko Popma
              rpopma Remko Popma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: