Search code examples
javacommand-line-interfaceapache-commons-cli

Can I use Commons CLI to commands line without - flags?


I don't know if I was clear, but I want to use Commons CLI without flags with minus, like -t or --args.

In fact I want to use it as the IRC commands.

In the example:

Options options = new Options();
options.addOption("send", false, "send text");

I created a option with -send. Could I create it without the minus?

Thank you all.


Solution

  • I achieve this changing the source code. In a certain part of the code is verified if the "--" is used. Remove this made the solution.

    However I see that the best was develop my own code. If someone need a simple code to parse "arg arg1" format here it is.

    https://github.com/faelcorreia/SimpleCLI