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

[CLI] Infinite Loop in Command-Line processing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1
    • CLI-1.x
    • None
    • Operating System: All
      Platform: All

    • 28005

    Description

      In some cases, CLI-2 hangs in an infinite loop. I've created the following Group:

      – snip –
      Option inputFormatOption = optionBuilder.withLongName("input-format")
      .create();
      Argument argument = argumentBuilder.withName("file")
      .create();
      Group children = groupBuilder.withName("options")
      .withOption(inputFormatOption)
      .create();
      Command command = commandBuilder.withName("convert")
      .withChildren(children)
      .withArgument(argument)
      .create();
      Group root = groupBuilder.withName("commands")
      .withOption(createConvertCommand())
      .create();
      – snip –

      When I use the group:
      -snip-
      Parser parser = new Parser();
      parser.setGroup(root);
      parser.parse(args);
      – snip

      and use the following command line:
      convert test.txt --input-format a

      the parser hangs in an infinite loop.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cocoa Simon Raess
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: