Skip to content

Commit b8e015a

Browse files
authored
update picocli to 4.6.1 (#321)
1 parent 0730ca6 commit b8e015a

File tree

7 files changed

+19
-23
lines changed

7 files changed

+19
-23
lines changed

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/ImageTool.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.oracle.weblogic.imagetool.logging.LoggingFactory;
1616
import picocli.CommandLine;
1717
import picocli.CommandLine.Command;
18-
import picocli.CommandLine.HelpCommand;
1918
import picocli.CommandLine.ParseResult;
2019

2120
import static picocli.CommandLine.ExitCode;
@@ -27,12 +26,11 @@
2726
versionProvider = HelpVersionProvider.class,
2827
sortOptions = false,
2928
subcommands = {
30-
CacheCLI.class,
31-
CreateImage.class,
32-
UpdateImage.class,
33-
RebaseImage.class,
34-
InspectImage.class,
35-
HelpCommand.class
29+
CacheCLI.class,
30+
CreateImage.class,
31+
UpdateImage.class,
32+
RebaseImage.class,
33+
InspectImage.class
3634
},
3735
requiredOptionMarker = '*',
3836
abbreviateSynopsis = true,

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheAddOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import com.oracle.weblogic.imagetool.api.model.CommandResponse;
1010
import com.oracle.weblogic.imagetool.cachestore.CacheStoreException;
11-
import picocli.CommandLine;
11+
import picocli.CommandLine.Option;
1212

1313
import static com.oracle.weblogic.imagetool.cachestore.CacheStoreFactory.cache;
1414

@@ -45,14 +45,14 @@ Path absolutePath() {
4545

4646
private Path absolutePath = null;
4747

48-
@CommandLine.Option(
48+
@Option(
4949
names = {"--force"},
5050
description = "Overwrite existing entry, if it exists"
5151
)
5252
private boolean force = false;
5353

5454

55-
@CommandLine.Option(
55+
@Option(
5656
names = {"--path"},
5757
description = "Location on disk. For ex: /path/to/patch-or-installer.zip",
5858
required = true

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheCLI.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import com.oracle.weblogic.imagetool.cli.HelpVersionProvider;
99
import picocli.CommandLine.Command;
10-
import picocli.CommandLine.HelpCommand;
1110
import picocli.CommandLine.Unmatched;
1211

1312
@Command(
@@ -20,8 +19,7 @@
2019
AddInstallerEntry.class,
2120
AddPatchEntry.class,
2221
AddEntry.class,
23-
DeleteEntry.class,
24-
HelpCommand.class
22+
DeleteEntry.class
2523
},
2624
sortOptions = false
2725
)

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/cache/CacheOperation.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
package com.oracle.weblogic.imagetool.cli.cache;
55

6-
import java.util.ArrayList;
76
import java.util.List;
87
import java.util.concurrent.Callable;
98

@@ -15,7 +14,7 @@
1514
public abstract class CacheOperation implements Callable<CommandResponse> {
1615

1716
@Unmatched
18-
List<String> unmatchedOptions = new ArrayList<>();
17+
List<String> unmatchedOptions;
1918

2019
@Spec
2120
CommandSpec spec;

imagetool/src/main/java/com/oracle/weblogic/imagetool/cli/menu/InspectImage.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
import com.oracle.weblogic.imagetool.api.model.CommandResponse;
1313
import com.oracle.weblogic.imagetool.inspect.InspectOutput;
1414
import com.oracle.weblogic.imagetool.util.Utils;
15-
import picocli.CommandLine;
15+
import picocli.CommandLine.Command;
16+
import picocli.CommandLine.Option;
1617

17-
@CommandLine.Command(
18+
@Command(
1819
name = "inspect",
1920
description = "Inspect an image created by this tool",
2021
requiredOptionMarker = '*',
@@ -40,28 +41,28 @@ public CommandResponse call() throws Exception {
4041
return CommandResponse.success(null);
4142
}
4243

43-
@CommandLine.Option(
44+
@Option(
4445
names = {"--image", "-i"},
4546
required = true,
4647
paramLabel = "IMAGE:ID",
4748
description = "Image ID or image name to be inspected"
4849
)
4950
private String imageName;
5051

51-
@CommandLine.Option(
52+
@Option(
5253
names = {"--builder", "-b"},
5354
description = "Executable to inspect docker images. Default: ${DEFAULT-VALUE}"
5455
)
5556
String buildEngine = "docker";
5657

57-
@CommandLine.Option(
58+
@Option(
5859
names = {"--patches"},
5960
description = "Include OPatch information in the output, including a list of patches applied.",
6061
defaultValue = "false"
6162
)
6263
private boolean listPatches;
6364

64-
@CommandLine.Option(
65+
@Option(
6566
names = {"--format"},
6667
paramLabel = "FORMAT",
6768
description = "Output format. Supported values: ${COMPLETION-CANDIDATES} Default: ${DEFAULT-VALUE}",

imagetool/src/test/java/com/oracle/weblogic/imagetool/cli/ImageToolTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void testHelp() {
4949
// HELP argument should return usage but success code
5050
CommandResponse response = ImageTool.run(ImageTool.class, printStream, printStream, "help");
5151
assertNotNull(response);
52-
assertEquals(0, response.getStatus());
52+
assertEquals(2, response.getStatus());
5353
assertTrue(byteArrayOutputStream.toString().contains("Usage: imagetool [OPTIONS]"));
5454
}
5555

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<dependency>
6262
<groupId>info.picocli</groupId>
6363
<artifactId>picocli</artifactId>
64-
<version>4.3.2</version>
64+
<version>4.6.1</version>
6565
</dependency>
6666
<dependency>
6767
<groupId>org.json</groupId>

0 commit comments

Comments
 (0)