commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Razvan Surdulescu" <razvan.surdule...@post.harvard.edu>
Subject [CLI] Documentation problems?
Date Wed, 21 May 2003 18:10:30 GMT
There seem to be some problems in the CLI documentation:
http://jakarta.apache.org/commons/cli/usage.html

1. In the section entitled "Parsing the command line arguments", the
following code does not compile since Options does not have a parse()
method:

CommandLine cmd = options.parse(args);

2. I am not able to have command line options of the form "-word" where
"word" is longer than 1 letter, although the documentation seems to imply
that this should be possible via the "ANT Example".

Specifically, the following snippet:

        Options options = new Options();
        options.addOption(OptionBuilder
                .withDescription("dynamically generate mining model XML")
                .create("generate"));

        CommandLineParser parser = new PosixParser();
        try {
            CommandLine line = parser.parse(options, args);
        } catch (ParseException pe) {
            System.err.println(pe.getMessage());
        }

fails with:

Unrecognized option: -g

when I execute it with:

javaw.exe -classpath commons-cli-1.0.jar Test -generate

Mime
View raw message