|
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,42 @@ 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" ) |
| 627 | + .desc( "Counts the program NCSS (default)." ) |
| 628 | + .build() ); |
| 629 | + options.addOption( builder("package") |
| 630 | + .desc( "Assembles a statistic on package level." ) |
| 631 | + .build()); |
| 632 | + options.addOption( builder("object") |
| 633 | + .desc( "Counts the object NCSS." ) |
| 634 | + .build()); |
| 635 | + options.addOption( builder( "function" ) |
| 636 | + .desc( "Counts the function NCSS." ) |
| 637 | + .build() ); |
| 638 | + options.addOption( builder( "all" ) |
| 639 | + .desc( "The same as '-function -object -package'." ) |
| 640 | + .build() ); |
| 641 | + options.addOption( builder( "gui" ) |
| 642 | + .desc( "Opens a GUI to present the '-all' output in tabbed panels." ) |
| 643 | + .build() ); |
| 644 | + options.addOption( builder( "xml" ) |
| 645 | + .desc( "Output in XML format." ) |
| 646 | + .build() ); |
| 647 | + options.addOption( builder( "out" ) |
| 648 | + .hasArg().argName("outFile") |
| 649 | + .desc( "Output file name. By default output goes to standard out." ) |
| 650 | + .build()); |
| 651 | + options.addOption( builder( "recursive" ) |
| 652 | + .desc( "Recurse to subdirs." ) |
| 653 | + .build()); |
| 654 | + options.addOption( builder( "encoding" ) |
| 655 | + .hasArg().argName("encoding") |
| 656 | + .desc( "Encoding used while reading source files (default: platform encoding)." ) |
| 657 | + .build() ); |
635 | 658 |
|
636 | 659 | CommandLine cl;
|
637 | 660 |
|
|
0 commit comments