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

CliBuilder kills head/tail quotes from argument

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.0
    • None
    • None

    Description

      $ cat bug-paf-2.groovy
      def cli = new CliBuilder()
      cli.with {
      	f longOpt:'json-filter','jq expression', args: 1
      }
      def opt = cli.parse(args)
      print "${opt.f}\n"
      $ 
      
      $ groovy bug-paf-2.groovy -f '"test"'  #expected "test", got:
      test
      $ groovy bug-paf-2.groovy -f '"test'  #expected "test, got:
      test
      $ groovy bug-paf-2.groovy -f 'test"' #expected test", got:
      test
      
      $ groovy bug-paf-2.groovy -f "\"test\""  #expected "test", got:
      test
      $ groovy bug-paf-2.groovy -f "\"test"  #expected "test, got:
      test
      $ groovy bug-paf-2.groovy -f "test\"" #expected test", got:
      test
      

      looks like somebody clears head/tail quotes.
      this must not be done.

      removing quotes/apostrophes is a task for shell, once data gets to argv, no unquoting must be done on it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              neopaf Alexander Petrossian (PAF)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: