static void Main(string[] args) { Zip zip = new Zip(); OutputConsole.StartMessage(); Console.ReadKey(); Console.WriteLine(); Console.CancelKeyPress += Handler; try { var options = Parser.Default.ParseArguments <DecompressionOption, CompressionOption>(args) .WithParsed <CompressionOption>(opts => Run(CompressionMode.Compress, opts)) .WithParsed <DecompressionOption>(opts => Run(CompressionMode.Decompress, opts)) .WithNotParsed(errors => WorkError(errors)); } catch (Exception ex) { OutputConsole.DisplayError(ex); } OutputConsole.ExitMessage(); Console.ReadKey(); }
private static void WorkError(object errors) { OutputConsole.ShowMessage("Неверный синтаксис команды."); }