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

Support options like Java memory settings (-Xmx512M)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: Parser
    • Labels:
      None

      Description

      This is a RFE to implement the java memory setting style of option, that is a single hyphen with a long option name and a value immediately after.

      For example: -Xmx512M

      public void testJavaMemorySettings() throws Exception {
          Options options = new Options();
          options.addOption(OptionBuilder.withLongOpt("Xmx").hasArg().create("Xmx"));
      
          Parser parser = new GnuParser();
          CommandLine cl = parser.parse(options, new  String[] { "-Xmx512M" });
      
          assertTrue(cl.hasOption("Xmx"));
          assertEquals("512M", cl.getOptionValue("Xmx"));
      }
      

        Attachments

          Activity

            People

            • Assignee:
              ebourg Emmanuel Bourg
              Reporter:
              ebourg Emmanuel Bourg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: