forked from remkop/picocli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[remkop#1316] Bugfix: Avoid
DuplicateOptionAnnotationsException
thr…
…own on `mixinStandardHelpOptions` for subcommands when parent has `scope = INHERIT` by `picocli-codegen` annotation processor. Closes remkop#1316
- Loading branch information
1 parent
e1b5848
commit 735f951
Showing
5 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ion-processing-tests/src/test/java/picocli/annotation/processing/tests/Issue1316Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package picocli.annotation.processing.tests; | ||
|
||
import com.google.testing.compile.Compilation; | ||
import com.google.testing.compile.JavaFileObjects; | ||
import org.junit.Test; | ||
|
||
import javax.annotation.processing.Processor; | ||
|
||
import static com.google.testing.compile.CompilationSubject.assertThat; | ||
import static com.google.testing.compile.Compiler.javac; | ||
|
||
public class Issue1316Test { | ||
@Test | ||
public void testIssue1316() { | ||
Processor processor = new AnnotatedCommandSourceGeneratorProcessor(); | ||
Compilation compilation = | ||
javac() | ||
.withProcessors(processor) | ||
.compile(JavaFileObjects.forResource( | ||
"picocli/issue1316/Example.java")); | ||
|
||
assertThat(compilation).succeeded(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
picocli-annotation-processing-tests/src/test/resources/picocli/issue1316/Example.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package picocli.issue1316; | ||
|
||
import picocli.CommandLine; | ||
import picocli.AutoComplete; | ||
|
||
@CommandLine.Command( | ||
name = "example", | ||
mixinStandardHelpOptions = true, | ||
scope = CommandLine.ScopeType.INHERIT, | ||
subcommands = AutoComplete.GenerateCompletion.class | ||
) | ||
public class Example { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters