|
36 | 36 | import org.apache.commons.cli.CommandLine;
|
37 | 37 | import org.apache.commons.cli.DefaultParser;
|
38 | 38 | import org.apache.commons.cli.HelpFormatter;
|
39 |
| -import org.apache.commons.cli.OptionBuilder; |
| 39 | +import static org.apache.commons.cli.Option.builder; |
40 | 40 | import org.apache.commons.cli.Options;
|
41 | 41 | import org.apache.commons.cli.ParseException;
|
42 | 42 |
|
@@ -619,19 +619,20 @@ public Javancss( String[] args, String sRcsHeader_ ) throws IOException
|
619 | 619 | public Javancss( String[] args ) throws IOException
|
620 | 620 | {
|
621 | 621 | Options options = new Options();
|
622 |
| - options.addOption( OptionBuilder.create( "help" ) ); |
623 |
| - options.addOption( OptionBuilder.create( "version" ) ); |
624 |
| - options.addOption( OptionBuilder.create( "debug" ) ); |
625 |
| - options.addOption( OptionBuilder.withDescription( "Counts the program NCSS (default)." ).create( "ncss" ) ); |
626 |
| - options.addOption( OptionBuilder.withDescription( "Assembles a statistic on package level." ).create( "package" ) ); |
627 |
| - options.addOption( OptionBuilder.withDescription( "Counts the object NCSS." ).create( "object" ) ); |
628 |
| - options.addOption( OptionBuilder.withDescription( "Counts the function NCSS." ).create( "function" ) ); |
629 |
| - options.addOption( OptionBuilder.withDescription( "The same as '-function -object -package'." ).create( "all" ) ); |
630 |
| - options.addOption( OptionBuilder.withDescription( "Opens a GUI to present the '-all' output in tabbed panels." ).create( "gui" ) ); |
631 |
| - options.addOption( OptionBuilder.withDescription( "Output in XML format." ).create( "xml" ) ); |
632 |
| - options.addOption( OptionBuilder.withDescription( "Output file name. By default output goes to standard out." ).create( "out" ) ); |
633 |
| - options.addOption( OptionBuilder.withDescription( "Recurse to subdirs." ).create( "recursive" ) ); |
634 |
| - options.addOption( OptionBuilder.withDescription( "Encoding used while reading source files (default: platform encoding)." ).hasArg().create( "encoding" ) ); |
| 622 | + |
| 623 | + options.addOption( builder( "help" ).build()); |
| 624 | + options.addOption( builder( "version" ).build() ); |
| 625 | + options.addOption( builder( "debug" ).build() ); |
| 626 | + options.addOption( builder( "ncss" ).desc( "Counts the program NCSS (default)." ).build() ); |
| 627 | + options.addOption( builder( "package" ).desc( "Assembles a statistic on package level." ).build() ); |
| 628 | + options.addOption( builder( "object" ).desc( "Counts the object NCSS." ).build()); |
| 629 | + options.addOption( builder( "function" ).desc( "Counts the function NCSS." ).build() ); |
| 630 | + options.addOption( builder( "all" ).desc( "The same as '-function -object -package'." ).build() ); |
| 631 | + options.addOption( builder( "gui" ).desc( "Opens a GUI to present the '-all' output in tabbed panels." ).build() ); |
| 632 | + options.addOption( builder( "xml" ).desc( "Output in XML format." ).build() ); |
| 633 | + options.addOption( builder( "out" ).hasArg().argName("outFile").desc( "Output file name. By default output goes to standard out." ).build()); |
| 634 | + options.addOption( builder( "recursive" ).desc( "Recurse to subdirs." ).build()); |
| 635 | + options.addOption( builder( "encoding" ).hasArg().argName("encoding").desc( "Encoding used while reading source files (default: platform encoding)." ).build() ); |
635 | 636 |
|
636 | 637 | CommandLine cl;
|
637 | 638 |
|
|
0 commit comments