Closed Bajger closed 1 year ago
Closing issue, it was resolved by: https://github.com/pharo-project/pharo-launcher/commit/2a7ae66f9239a148571d7c1e2a7191b7d348c090#diff-1a6049d3220a5b2319d7d16f035361bb3ec7f52b284455e7e9769f6b2ba76e6eR333 Command will initialize model from context lazily just once.
For command line handler activation (that will have launcher as implicit command) we can have another issue, if needed.
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 ownPhLCliCommandLineHandler>>activate
that would have 'launcher' id (of command) and activatePhLCliClapContext
instance. As an consequence, command line usage would not needclap
as a first command, but onlylauncher
command. Refactoring of PhLCliCommand would be needed, since this command already useslauncher
id (so thatlauncher
is used just in cmd line handler activation).