In the example above, MyApp now has a main method, that accepts arguments
like first a b or second c d. In the first case, it will create a First, and
call its body (whose initialization is delayed thanks to delayed initialization). In the
second case, it will create a Second instead, and call its body too.
Have a sealed trait extend this for its case class children to become commands.
Extends
DelayedInitlikeAppdoes.Like with
App, the remaining arguments are accessible with the methodremainingArgs.Example
In the example above,
MyAppnow has amainmethod, that accepts arguments likefirst a borsecond c d. In the first case, it will create aFirst, and call its body (whose initialization is delayed thanks to delayed initialization). In the second case, it will create aSecondinstead, and call its body too.