Skip to content
Merged
Changes from 1 commit
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
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().longOpt("file").desc("The file to be processed").hasArg().argName("FILE").required().option("f").get());
* options.addOption(Option.builder().longOpt("version").desc("Print the version of the application").option("v").get());
* options.addOption(Option.builder().longOpt("help").option("h").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