mirror of
https://github.com/jlengrand/swacli.git
synced 2026-03-10 08:41:24 +00:00
feat/graal
SwaCLI : A simple Star Wars CLI tool
Created using :
This repository contains several small CLIs that aim at demonstrating the various capabilities of picoCLI.
You can find :
- SwaCLIBasic Not doing anything but showing how picoCLI comes with batteries included
- SwaCLIOptions A small demonstration on how to use (mutually exclusive) options and arguments
- SwaCLISubCommands A small demonstration on how to use subcommands
- SwaCLIProgrammatic An example that uses the programmatic API instead of the annotation system.
- SwaCLISubCommandsTest An example on how to test commandline configurations
All examples are in Kotlin and provide the same rough capabilities (get some facts about characters or planets in Star Wars)
Running
$ ./gradlew customFatJar
$ java -cp build/libs/all-in-one-jar-1.0-SNAPSHOT.jar nl.lengrand.swacli.SwaCLI
# to keep color and paginate the results
$ java -Dpicocli.ansi=true -cp build/libs/all-in-one-jar-1.0-SNAPSHOT.jar nl.lengrand.swacli.SwaCLIOptions -p | less -R
# to create the native image
$ cd build/libs;native-image --static -jar all-in-one-jar-1.0-SNAPSHOT.jar sw
# remove static if you're on Mac :)
$ cd build/libs;native-image -jar all-in-one-jar-1.0-SNAPSHOT.jar sw
Why
This is an example CLI that I created as illustration for my JFall 2020 talk
Source
Author
Description
Languages
Kotlin
100%