protected boolean collectOptions(final Options options, final String[] args) {
        try {
            if (args != null && args.length > 0) {
                CommandLineParser parser = new PosixParser();
                CommandLine line = parser.parse(options, args);
                return processLine(line, options);
            }
            return true;
        } catch (ParseException e) {
            log.error("Invalid option", e);
            return false;
        } catch (IllegalArgumentException e) {
            log.error("Invalid option value", e);
            return false;
        }
    }
protected boolean collectOptions ( final Options options , final String [ ] args ) { try { if ( args != null && args . length > 0 ) { CommandLineParser parser = new PosixParser ( ) ; CommandLine line = parser . parse ( options , args ) ; return processLine ( line , options ) ; } return true ; } catch ( ParseException e ) { log . error ( "Invalid option" , e ) ; return false ; } catch ( IllegalArgumentException e ) { log . error ( "Invalid option value" , e ) ; return false ; } }
Take arguments received on the command line and setup corresponding
options.
<p/>
No arguments is valid. It means use the defaults.

@param options the expected options
@param args the actual arguments received on the command line
@return true if arguments were valid