You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ If the found argumemt is detected as command, than CmdOptions switches into the
145
145
After CmdOption switched into command mode once, all succeeding arguments are only parsed into the scope of that command.
146
146
147
147
If the application supports parameters (non-options, declared with a `@CmdOption` annotation without a `names` parameter)
148
-
the parser will scan all commandline arguemnts that are not detected as options or commands into that parameter.
148
+
the parser will scan all commandline arguments that are not detected as options or commands into that parameter.
149
149
150
150
=== Stop option detecting with `--`
151
151
@@ -166,6 +166,57 @@ If desired, you can change the prefix with `CmdlineParser.setReadArgsFromFilePre
166
166
The given string must be at least one character long.
167
167
With an empty string or `null` you can disable that feature completely.
168
168
169
+
=== Aggregation of short options
170
+
171
+
_By principle, CmdOption does not enforce any type of option format.
172
+
But nevertheless, the most common variants for Java applications are the Java-style options (starting with a single dash ("-")) and GNU-style options (long options starting with a double dash ("--") and short options starting with a single dash ("-"))._
173
+
174
+
_A typical convenience feature of GNU-style parsers is to support aggreated short options.
175
+
That means, instead of declaring each option separately as in `ls -l -a` you can write them as one `ls -la`.
176
+
You can do the same with CmdOption._
177
+
178
+
If you tell CmdOption which prefix starts a short option (an option with consists of only a single character after the prefix), CmdOption can parse all those option also when given in an aggreated way.
179
+
By default, this feature is disabled.
180
+
181
+
To enable aggregation of short options use `CmdlineParser.setAggregateShortOptionsWithPrefix(String)`.
182
+
An argument of `null` or the empty string disables this feature.
0 commit comments