File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4351,4 +4351,30 @@ public void testIssue1680MultiplicityZeroCausesInfiniteLoop() {
4351
4351
}
4352
4352
}
4353
4353
4354
+ @ Test
4355
+ public void testReuseBothCommandLineAndUserObjectWithArgGroup () {
4356
+ MyCommand userObject = new MyCommand ();
4357
+ CommandLine cmdLine = new CommandLine (userObject );
4358
+ cmdLine .execute ("--group" , "group" , "--option" , "option" );
4359
+ cmdLine .execute ();
4360
+ assertNull ("Expected option to be reset to null" , userObject .option );
4361
+ assertNull ("Expected group option to be reset to null" , userObject .group .option );
4362
+ }
4363
+
4364
+ @ Command (name = "command" )
4365
+ static class MyCommand implements Runnable {
4366
+ @ Option (names = "--option" /*, defaultValue = Option.NULL_VALUE*/ )
4367
+ private String option ;
4368
+
4369
+ @ ArgGroup
4370
+ private Group group = new Group ();
4371
+
4372
+ private static class Group {
4373
+ @ Option (names = "--group" , defaultValue = Option .NULL_VALUE )
4374
+ private String option ;
4375
+ }
4376
+
4377
+ public void run () {
4378
+ }
4379
+ }
4354
4380
}
You can’t perform that action at this time.
0 commit comments