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

CliBuilder should ignore 'opt' property if provided within a Map of arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0-rc-3
    • 2.5.0
    • None
    • None

    Description

      println "groovy version = ${GroovySystem.getVersion()}"
      def builder = new CliBuilder()
      def opt1 = [opt:'x']
      builder."${opt1.opt ?: '_'}"(opt1, 'desc opt1')  // problem is here
      def opt2 = [opt:'y',longOpt:'why']
      builder."${opt2.opt ?: '_'}"(opt2, 'desc opt1')  // problem is here
      def opt3 = [opt:'z',longOpt:'zed',argName:'arg',args:1]
      builder."${opt3.opt ?: '_'}"(opt3, 'desc opt3')  // problem is here
      def opt4 = [longOpt:'quiet']
      builder."${opt4.opt ?: '_'}"(opt4, 'desc opt:')  // problem is here
      println builder.options
      builder.usage()
      

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: