@@ -57,14 +57,44 @@ public class DefaultParser implements CommandLineParser
5757 /** Flag indicating if partial matching of long options is supported. */
5858 private boolean allowPartialMatching ;
5959
60- /** Creates a new DefaultParser instance with partial matching enabled. */
60+ /**
61+ * Creates a new DefaultParser instance with partial matching enabled.
62+ *
63+ * By "partial matching" we mean that given the following code:
64+ * <pre>
65+ * {@code
66+ * final Options options = new Options();
67+ * options.addOption(new Option("d", "debug", false, "Turn on debug."));
68+ * options.addOption(new Option("e", "extract", false, "Turn on extract."));
69+ * options.addOption(new Option("o", "option", true, "Turn on option with argument."));
70+ * }
71+ * </pre>
72+ * with "partial matching" turned on, <code>-de</code> only matches the
73+ * <code>"debug"</code> option. However, with "partial matching" disabled,
74+ * <code>-de</code> would enable both <code>debug</code> as well as
75+ * <code>extract</code> options.
76+ */
6177 public DefaultParser () {
6278 this .allowPartialMatching = true ;
6379 }
6480
6581 /**
6682 * Create a new DefaultParser instance with the specified partial matching policy.
6783 *
84+ * By "partial matching" we mean that given the following code:
85+ * <pre>
86+ * {@code
87+ * final Options options = new Options();
88+ * options.addOption(new Option("d", "debug", false, "Turn on debug."));
89+ * options.addOption(new Option("e", "extract", false, "Turn on extract."));
90+ * options.addOption(new Option("o", "option", true, "Turn on option with argument."));
91+ * }
92+ * </pre>
93+ * with "partial matching" turned on, <code>-de</code> only matches the
94+ * <code>"debug"</code> option. However, with "partial matching" disabled,
95+ * <code>-de</code> would enable both <code>debug</code> as well as
96+ * <code>extract</code> options.
97+ *
6898 * @param allowPartialMatching if partial matching of long options shall be enabled
6999 */
70100 public DefaultParser (final boolean allowPartialMatching ) {
0 commit comments