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
var args =newString[]{"--foo-bar", "hoge", "--baz", "1", "-z=2", "-x", "fuga"};
137
139
var cliargs =newCliArgs("path/to/app", args);
138
140
@@ -158,7 +160,7 @@ option is not specified in command line arguments.
158
160
};
159
161
160
162
var result = cliargs.parseWith(optCfgs);
161
-
if (result.exception() !=null) {
163
+
if (result.exception() ==null) {
162
164
var cmd = result.cmd();
163
165
cmd.getName(); // "app"
164
166
cmd.getArgs(); // ["hoge", "fuga"]
@@ -227,8 +229,8 @@ And `arg` is what to specify a text for an option argument value in help text.
227
229
var options =newOptions();
228
230
229
231
var result = cliargs.parseFor(options);
230
-
var cmd = result.cmd();
231
232
var optCfgs = result.optCfgs();
233
+
var cmd = result.cmdOrThrow();
232
234
233
235
cmd.getName(); // "app"
234
236
cmd.getArgs(); // ["hoge", "fuga"]
@@ -365,7 +367,7 @@ And the help text can be generated as follows:
365
367
This library supports native build with GraalVM.
366
368
However, since it utilizes reflection for the option store object passed to `CliArgs#parseFor`, the reflection configurations for the classof this object need to be specified in `reflect-config.json`. The configuration are as follows:
0 commit comments