You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by rmatthews <rm...@nakedobjects.org> on 2009/05/13 17:03:45 UTC

CLI short option name in error message, when long was given as parameter

I have a series of parameters in short and long form where the last one in
the following example takes an argument:

-s -t exploration -v dnd --fixture

The error that I get with CLI using the following code 

        final CommandLineParser parser = new BasicParser();
        this.cmd = null;
        try {
            cmd = parser.parse(options, args);
        } catch (final ParseException e) {
            printer.printErrorMessage(e.getMessage());
            printer.printHelp(options);
            return false;
        }


is

  Error: no argument for:f

Why does it give the message using the short option name rather than the
long option name that was used?  Is my recollection  that it has changed
correct, or is this the way it always worked?  Is there some way of changing
this behaviour.

Many thanks
Robert Matthews
-- 
View this message in context: http://www.nabble.com/CLI-short-option-name-in-error-message%2C-when-long-was-given-as-parameter-tp23523659p23523659.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org