pharo-launcher
pharo-launcher copied to clipboard
Implement better initialization of Pharo launcher model for CLI
Describe the request
Currently, new instance of PharoLauncherModel is created every time the accessor launcherModel
is invoked. This could be several times during program execution. PharoLauncherModel should be initialized just once, during image startup and command activation.
Expected behavior
Instead of using ClapContext
we should use PhLCliClapContext, that uses proper accessors for launcher model (that are already initialized).
Expected development cost
It seems that ClapContext is activated in the ClapCommandLineHandler>>activate
. Probably we should use something like own PhLCliCommandLineHandler>>activate
that would have 'launcher' id (of command) and activate PhLCliClapContext
instance.
As an consequence, command line usage would not need clap
as a first command, but only launcher
command.
Refactoring of PhLCliCommand would be needed, since this command already uses launcher
id (so that launcher
is used just in cmd line handler activation).