This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git
The following commit(s) were added to refs/heads/master by this push:
new bf051247 Fix formatting of examples in the user guide.
bf051247 is described below
commit bf0512470241e410adb2ee011e0b973b7a0605e4
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Aug 1 13:48:21 2026 -0400
Fix formatting of examples in the user guide.
---
src/main/javadoc/overview.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html
index 6c142b23..f0f9d58b 100644
--- a/src/main/javadoc/overview.html
+++ b/src/main/javadoc/overview.html
@@ -172,8 +172,8 @@ options.addOption("t", false, "display current time");
of the <code>CommandLineParser</code> interface, the recommended one
is the
<code>DefaultParser</code>.
</p>
- <code>CommandLineParser parser = new DefaultParser();
-CommandLine cmd = parser.parse(options, args);</code>
+ <pre><code>CommandLineParser parser = new DefaultParser();
+CommandLine cmd = parser.parse(options, args);</code></pre>
<p>
Now we need to check if the <code>t</code> option is present. To do
this we will interrogate the
@@ -183,7 +183,7 @@ CommandLine cmd = parser.parse(options, args);</code>
represented by the <code>java.lang.String</code> is present,
otherwise
it returns <code>false</code>.
</p>
- <pre><code>if(cmd.hasOption("t")) {
+ <pre><code>if (cmd.hasOption("t")) {
// print the date and time
} else {
// print the date
@@ -232,7 +232,7 @@ options.addOption("c", true, "country code");</code></pre>
<pre><code>// get c option value
String countryCode = cmd.getOptionValue("c");
-if(countryCode == null) {
+if (countryCode == null) {
// print default date
} else {
// print date for country specified by countryCode