Class Modules
- java.lang.Object
-
- com.github.rvesse.airline.examples.modules.Modules
-
- All Implemented Interfaces:
ExampleRunnable
@Command(name="modules", description="A command that demonstrates the use of modules to group together sets of options for composition and reuse") public class Modules extends java.lang.Object implements ExampleRunnable
If you have some set of options that make sense together you can modularize them out as a class and inject them into your actual command classThis is particularly useful if you want to avoid using inheritance for options, especially in cases where different commands may use different combinations of some common option sets
-
-
Field Summary
Fields Modifier and Type Field Description CredentialsModulecredentialsA field marked withAirlineModulewill also be scanned for optionsprivate HelpOption<ExampleRunnable>helpVerbosityModuleverbosityA field marked withAirlineModulewill also be scanned for options
-
Constructor Summary
Constructors Constructor Description Modules()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)intrun()Runs the command and returns an exit code that the application should return
-
-
-
Field Detail
-
help
@AirlineModule private HelpOption<ExampleRunnable> help
-
credentials
@AirlineModule public CredentialsModule credentials
A field marked withAirlineModulewill also be scanned for options
-
verbosity
@AirlineModule public VerbosityModule verbosity
A field marked withAirlineModulewill also be scanned for options
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
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
-
-