Skip to content

Commit

Permalink
CLI: Change default short option to display version from "-V" to "-v"
Browse files Browse the repository at this point in the history
The current short option to display the version is "-V" (uppercase): `quarkus -V`. This is set by Picocli, but can be changed using the `picocli.version.name.0` property.

The problem with `-V` is that does not match with the other short options to display version in the extensions and other commands which is "-v".
Also, in other command tools like `mvn`, the option is `-v`.
I did check that the `-v` is not conflicting with other existing options.
  • Loading branch information
Sgitario committed Jun 2, 2021
1 parent 27ba1cb commit bca4177
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions devtools/cli/src/main/java/io/quarkus/cli/QuarkusCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class QuarkusCli implements QuarkusApplication, Callable<Integer> {

static {
System.setProperty("picocli.endofoptions.description", "End of command line options.");
// Change default short option to display version from "-V" to "-v":
System.setProperty("picocli.version.name.0", "-v");
}

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public void testCommandVersion() throws Exception {
CliDriver.Result result = CliDriver.execute("version");
result.echoSystemOut();

CliDriver.Result result2 = CliDriver.execute("-V");
CliDriver.Result result2 = CliDriver.execute("-v");
Assertions.assertEquals(result.stdout, result2.stdout, "Version output for command aliases should be the same.");
CliDriver.println("-- same as above\n\n");

Expand Down

0 comments on commit bca4177

Please sign in to comment.