In particular, using a concrete enum instead of a string to avoid an
unnecessary incomplete pattern-match, and remove superfluous comments.
Signed-off-by: KtorZ <5680256+KtorZ@users.noreply.github.com>
For the program to be consistent, the 'EventListener' target that we
pass to a Project should be responsible for the output format.
Otherwise, we are contingent on developers to remember passing the
option at call-site. Plus, it overloads the project code with an extra
boolean option.
Instead, since the behaviour is solely driven by the execution
context, we can instantiate a different event target upfront, and
simply hold on to it throughout the program.
As a nice side-effect, we can gently re-organize the code to keep the
terminal printing logic and the json printing logic separate.