Class Simple
java.lang.Object
com.github.rvesse.airline.examples.simple.Simple
- All Implemented Interfaces:
ExampleRunnable
@Command(name="simple",
description="A simple example command")
public class Simple
extends Object
implements ExampleRunnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionTheArgumentsannotation allows commands to take in additional arbitrary argumentsprivate booleanprivate HelpOption<Simple> The specialHelpOptionprovides a-hand--helpoption that can be used to request that help be shown.private StringHere we declare an option that requires a value by using thearityfield of theOptionannotationprivate intAs we declare this field to be of typeintAirline will ensure that the value passed to this option can be converted to an integer and throws an error if this is not possible -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
help
The specialHelpOptionprovides a-hand--helpoption that can be used to request that help be shown.Developers need to check the
HelpOption.showHelpIfRequested()method which will display help if requested and returntrueif the user requested the help -
flag
@Option(name={"-f","--flag"}, description="An option that requires no arguments") private boolean flag -
name
-
number
@Option(name="--number", title="Number", arity=1, description="An option that takes a numeric argument") private int numberAs we declare this field to be of typeintAirline will ensure that the value passed to this option can be converted to an integer and throws an error if this is not possible -
args
TheArgumentsannotation allows commands to take in additional arbitrary arguments
-
-
Constructor Details
-
Simple
public Simple()
-
-
Method Details
-
main
-
run
public int run()Description copied from interface:ExampleRunnableRuns the command and returns an exit code that the application should return- Specified by:
runin interfaceExampleRunnable- Returns:
- Exit code
-