Example #1
0
        private async Task ExecuteConsoleCommandFileExport(Options options)
        {
            if (options.Parameters.Count == 0)
            {
                var getFileExportFormatsQuery = new GetFileExportFormatsQuery(options);
                var formatsArray = await _mediator.Send(getFileExportFormatsQuery);

                _consolePrinter.PrintExportFormats(formatsArray);
            }

            if (options.Parameters.Count == 1)
            {
                var fileExportCommand = new FileExportQuery(options);
                await _mediator.Send(fileExportCommand);

                LogInformationMessage($"Meta-info file has been exported to '{fileExportCommand.DestinationPath}'");
                _consolePrinter.PrintExportSuccessfull(fileExportCommand.DestinationPath);
            }
        }