Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-254

"test" gets parsed as test, quotes die :-(

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      def cli = new CliBuilder()
      cli.with {
        f longOpt:'json-filter','jq expression', args: 1
      }
      def vals = ['test', 't"es"t',
                  "'test", "test'", "'test'",
                  '"test', 'test"', '"test"']
      vals.each {
        def opt = cli.parse(['-f', it])
        assert opt.f == it
      }
      

      It fails on last entry: "test".

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                neopaf Alexander Petrossian (PAF)
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m