Package io.dropwizard.core.cli
Class Cli
- java.lang.Object
-
- io.dropwizard.core.cli.Cli
-
public class Cli extends Object
The command-line runner for Dropwizard application.
-
-
Constructor Summary
Constructors Constructor Description Cli(JarLocation location, Bootstrap<?> bootstrap, OutputStream stdOut, OutputStream stdErr)
Create a new CLI interface for a application and its bootstrapped environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrintWriter
getStdErr()
PrintWriter
getStdOut()
Optional<Throwable>
run(String... arguments)
Runs the command line interface given some arguments.
-
-
-
Constructor Detail
-
Cli
public Cli(JarLocation location, Bootstrap<?> bootstrap, OutputStream stdOut, OutputStream stdErr)
Create a new CLI interface for a application and its bootstrapped environment.- Parameters:
location
- the location of the applicationbootstrap
- the bootstrap for the applicationstdOut
- standard outstdErr
- standard err
-
-
Method Detail
-
run
public Optional<Throwable> run(String... arguments)
Runs the command line interface given some arguments.- Parameters:
arguments
- the command line arguments- Returns:
- the error or an empty optional if command succeeded
-
getStdOut
public PrintWriter getStdOut()
-
getStdErr
public PrintWriter getStdErr()
-
-