Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/org/apache/commons/cli/HelpFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Licensed to the Apache Software Foundation (ASF) under one or more
* </p>
* <pre>
* Options options = new Options();
* options.addOption(OptionBuilder.withLongOpt("file").withDescription("The file to be processed").hasArg().withArgName("FILE").isRequired().create('f'));
* options.addOption(OptionBuilder.withLongOpt("version").withDescription("Print the version of the application").create('v'));
* options.addOption(OptionBuilder.withLongOpt("help").create('h'));
* options.addOption(Option.builder("f").longOpt("file").desc("The file to be processed").hasArg().argName("FILE").required().get());
* options.addOption(Option.builder("v").longOpt("version").desc("Print the version of the application").get());
* options.addOption(Option.builder("h").longOpt("help").get());
*
* String header = "Do something useful with an input file\n\n";
* String footer = "\nPlease report issues at https://example.com/issues";
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/apache/commons/cli/help/HelpFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Licensed to the Apache Software Foundation (ASF) under one or more
*
* <pre>
* Options options = new Options();
* options.addOption(OptionBuilder.withLongOpt("file").withDescription("The file to be processed").hasArg().withArgName("FILE").isRequired().create('f'));
* options.addOption(OptionBuilder.withLongOpt("version").withDescription("Print the version of the application").create('v'));
* options.addOption(OptionBuilder.withLongOpt("help").create('h'));
* options.addOption(Option.builder("f").longOpt("file").desc("The file to be processed").hasArg().argName("FILE").required().get());
* options.addOption(Option.builder("v").longOpt("version").desc("Print the version of the application").get());
* options.addOption(Option.builder("h").longOpt("help").get());
*
* String header = "Do something useful with an input file";
* String footer = "Please report issues at https://example.com/issues";
*
* HelpFormatter formatter = new HelpFormatter();
* HelpFormatter formatter = HelpFormatter.builder().get();
* formatter.printHelp("myapp", header, options, footer, true);
* </pre>
* <p>
Expand Down