commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatthews <rmatth...@nakedobjects.org>
Subject CLI short option name in error message, when long was given as parameter
Date Wed, 13 May 2009 15:03:45 GMT

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


Mime
View raw message