-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Picoli example codestart for Quarkus JBang project type
- Loading branch information
Showing
7 changed files
with
113 additions
and
4 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
35 changes: 35 additions & 0 deletions
35
...ources/codestarts/quarkus-jbang/code/jbang-picocli-code/base/README.tpl.qute.md
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,35 @@ | ||
## Greet the world! | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java hello | ||
``` | ||
|
||
## Say Goodbye! | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java goodbye | ||
``` | ||
|
||
## Show help | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java -h | ||
``` | ||
|
||
or | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java --help | ||
``` | ||
|
||
## Show version | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java -V | ||
``` | ||
|
||
or | ||
|
||
```shell script | ||
./jbang src/EntryCommand.java -h | ||
``` |
19 changes: 19 additions & 0 deletions
19
...or-json/src/main/resources/codestarts/quarkus-jbang/code/jbang-picocli-code/codestart.yml
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,19 @@ | ||
name: jbang-picocli-code | ||
ref: picocli | ||
type: code | ||
language: | ||
base: | ||
data: | ||
resource: | ||
class-name: EntryCommand | ||
subcommands: "{HelloCommand.class, GoodByeCommand.class}" | ||
hello: | ||
name: "hello" | ||
description: "Greet World!" | ||
message: "Hello World!" | ||
goodbye: | ||
name: "goodbye" | ||
description: "Say goodbye to World!" | ||
message: "Goodbye World!" | ||
dependencies: | ||
- io.quarkus:quarkus-picocli |
32 changes: 32 additions & 0 deletions
32
...starts/quarkus-jbang/code/jbang-picocli-code/java/src/{resource.class-name}.tpl.qute.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,32 @@ | ||
//usr/bin/env jbang "$0" "$@" ; exit $? | ||
{#for dep in dependencies} | ||
//DEPS {dep.formatted-ga}:{quarkus.version} | ||
{/for} | ||
|
||
//JAVAC_OPTIONS -parameters | ||
// | ||
import io.quarkus.picocli.runtime.annotations.TopCommand; | ||
import picocli.CommandLine; | ||
|
||
@TopCommand | ||
@CommandLine.Command(mixinStandardHelpOptions = true, subcommands = {resource.subcommands}) | ||
public class {resource.class-name} { | ||
} | ||
|
||
@CommandLine.Command(name = "{resource.hello.name}", description = "{resource.hello.description}") | ||
class HelloCommand implements Runnable { | ||
|
||
@Override | ||
public void run() { | ||
System.out.println("{resource.hello.message}"); | ||
} | ||
} | ||
|
||
@CommandLine.Command(name = "{resource.goodbye.name}", description = "{resource.goodbye.description}") | ||
class GoodByeCommand implements Runnable { | ||
|
||
@Override | ||
public void run() { | ||
System.out.println("{resource.goodbye.message}"); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...urces/codestarts/quarkus-jbang/code/jbang-resteasy-code/base/README.tpl.qute.md
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,3 @@ | ||
```shell script | ||
./jbang src/GreetingResource.java | ||
``` |
3 changes: 0 additions & 3 deletions
3
...esources/codestarts/quarkus-jbang/project/quarkus-jbang/base/README.tpl.qute.md
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
# JBang Quarkus Project | ||
|
||
```shell script | ||
./jbang src/GreetingResource.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