Command line
This page describes how to integrate Lamp with the command line, as well as what to expect out of it.
Setting up
Adding Lamp dependency
To add Lamp to your project, add the following (depending on your project structure):
<dependencies>
<!-- Required for all platforms -->
<dependency>
<groupId>io.github.revxrsal</groupId>
<artifactId>lamp.common</artifactId>
<version>[VERSION]</version>
</dependency>
<!-- CLI module -->
<dependency>
<groupId>io.github.revxrsal</groupId>
<artifactId>lamp.cli</artifactId>
<version>[VERSION]</version>
</dependency>
</dependencies>dependencies {
// Required for all platforms
implementation 'io.github.revxrsal:lamp.common:[VERSION]'
// CLI module
implementation 'io.github.revxrsal:lamp.cli:[VERSION]'
}Latest version:
Optional: Preserve parameter names
Lamp identifies parameters by their names and uses them to generate relevant command metadata. By default, Java does not preserve parameter names reflectively. You need to add the following to your project:
Supported CLI types
java.util.Scannerin place of CommandActorjava.io.PrintStreamin place of CommandActor
Example
Execute and exit
Poll console indefinitely
Last updated
Was this helpful?