-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Builders can be used to construct the exact environment needed.
For example:
import org.tomitribe.crest.Main;
public class Example {
public static void main(String[] args) {
final Main main = Main.builder()
.properties(System.getProperties())
.env(System.getenv())
.out(System.out)
.err(System.err)
.in(System.in)
.exit(System::exit)
.command(PizzaCommands.class)
.command(SandwichCommands.class)
.build();
main.run(args);
}
}
The above can be reduced further using the following convenience builder method that defaults most the above:
import org.tomitribe.crest.Main;
public class Example {
public static void main(String[] args) {
final Main main = Main.systemDefaults()
.command(PizzaCommands.class)
.command(SandwichCommands.class)
.build();
main.run(args);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels