title: How to get console-app argument with no option name in Commons cli?
body: <p>This is my console input:</p>
  
  <p>java TCPPing –p –port 9900 –mps 30 –size 1000 pcB</p>
  
  <p>pcB is argument for option with no name.</p>
  
  <p>How do i get pcB argument that has no option?</p>
  
  <p>Small code part:</p>
  
  <pre><code>Options options = new Options();
  options.addOption("", "hostname", true, "Hostname"); //no option name
  options.addOption("port", "port", true, "TCP socket used for connection");
  
  CommandLineParser parser = new DefaultParser();
  CommandLine commandLine = parser.parse(options, args);
  
  Integer port = Integer.parseInt(cmd.getOptionValue("port")); //works fine
  String hostname = cmd.getOptionValue("hostname"); //doesn't work
  </code></pre>