Skip to content

Commit

Permalink
Merge pull request #19810 from ebullient/cli-19754
Browse files Browse the repository at this point in the history
CLI: docs and help for -P
  • Loading branch information
aloubyansky authored Sep 1, 2021
2 parents fe1a755 + f78e00a commit 127200b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import picocli.CommandLine.Model.CommandSpec;

public class TargetQuarkusVersionGroup {
final static String FULL_EXAMPLE = ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID + ":"
+ ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID + ":2.2.0.Final";
StreamCoords streamCoords = null;
String validStream = null;

Expand All @@ -18,7 +20,7 @@ public class TargetQuarkusVersionGroup {
CommandSpec spec;

@CommandLine.Option(paramLabel = "platformKey:streamId", names = { "-S",
"--stream" }, description = "A target stream, for example:%n io.quarkus.platform:999-SNAPSHOT%n io.quarkus.platform:2.0")
"--stream" }, description = "A target stream, for example:%n io.quarkus.platform:2.0")
void setStream(String stream) {
stream = stream.trim();
if (!stream.isEmpty()) {
Expand All @@ -34,7 +36,12 @@ void setStream(String stream) {
}

@CommandLine.Option(paramLabel = "groupId:artifactId:version", names = { "-P",
"--platform-bom" }, description = "A specific Quarkus platform BOM, for example:%n io.quarkus:quarkus-bom:2.0.0.Final")
"--platform-bom" }, description = "A specific Quarkus platform BOM, for example:%n"
+ " " + FULL_EXAMPLE + "%n"
+ " io.quarkus::999-SNAPSHOT"
+ " 2.2.0.Final%n"
+ "Default groupId: " + ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID + "%n"
+ "Default artifactId: " + ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID + "%n")
void setPlatformBom(String bom) {
bom = bom.replaceFirst("^::", "").trim();
if (!bom.isEmpty()) {
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/cli-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ Both `quarkus create` and `quarkus extension list` allow you to explicitly speci
1. Specify a specific Platform Release BOM
+
A https://quarkus.io/guides/platform#quarkus-platform-bom[Quarkus Platform release BOM] is identified by `groupId:artifactId:version` (GAV) coordinates. When specifying a platform release BOM, you may use empty segments to fallback to default values (groupId: `io.quarkus`, artifactId: `quarkus-bom`, version: cli version). If you specify only one segment (no `:`), it is assumed to be a version.
A https://quarkus.io/guides/platform#quarkus-platform-bom[Quarkus Platform release BOM] is identified by `groupId:artifactId:version` (GAV) coordinates. When specifying a platform release BOM, you may use empty segments to fallback to default values (shown with `quarkus create app --help`). If you specify only one segment (no `:`), it is assumed to be a version.
+
For example:
+
- Given the `2.0.0.Final` version of the CLI, specifying `-P :quarkus-bom:` is equivalent to `-P io.quarkus.platform:quarkus-bom:2.0.0.Final`.
- Specifying `-P 999-SNAPSHOT` is equivalent to `-P io.quarkus:quarkus-bom:999-SNAPSHOT`
- With the `2.0.0.Final` version of the CLI, specifying `-P :quarkus-bom:` is equivalent to `-P io.quarkus:quarkus-bom:2.0.0.Final`. Specifying `-P 999-SNAPSHOT` is equivalent to `-P io.quarkus:quarkus-bom:999-SNAPSHOT`.
- With the `2.1.0.Final` version of the CLI, `io.quarkus.platform` is the default group id. Specifying `-P :quarkus-bom:` is equivalent to `-P io.quarkus.platform:quarkus-bom:2.1.0.Final`. Note that you need to specify the group id to work with a snapshot, e.g `-P io.quarkus::999-SNAPSHOT` is equivalent to `-P io.quarkus:quarkus-bom:999-SNAPSHOT`.
+
Note: default values are subject to change. Using the `--dry-run` option will show you the computed value.
Expand Down

0 comments on commit 127200b

Please sign in to comment.