private static async Task <int> Handle(InspectCommandArgs args, IConsole console, CancellationToken ct)
        {
            var inspector = new CSharpInspector(new SystemConsoleLoggerAdapter(console, args.Verbose));

            if (!InspectionParametersFactory.TryCreate(args, out var parameters, out var message))
            {
                console.Error.WriteLine(message);

                return(1);
            }

            var output = GetOutputDestination(console, args);

            try
            {
                var results = inspector.InspectAsync(args.Path, parameters, ct);

                await output.GenerateFromResults(results);
            }
            catch (InspectionException exception)
            {
                console.Error.WriteLine(exception.Message);

                return(1);
            }

            return(0);
        }
 private static IOutputDestination GetOutputDestination(IConsole console, InspectCommandArgs args)
 {
     return(new MetricsView(console, args));
 }