private void ParseCommandLineArguments() { string commandLine = CommandLineNoExecutableName(); var parseResult = _parser.Parse <CommandLineOptions>(commandLine); if (!parseResult.Success) { Bail(parseResult.Error); } _options = parseResult.Value; if (!String.IsNullOrEmpty(_options.OutputFileName)) { try { var filePrinter = new FilePrinter(_options.OutputFileName); _context.Printer = filePrinter; } catch (IOException ex) { Bail("Error creating output file: {0}", ex.Message); } } }
private void ParseCommandLineArguments() { string commandLine = CommandLineNoExecutableName(); var parseResult = _parser.Parse<CommandLineOptions>(commandLine); if (!parseResult.Success) { Bail(parseResult.Error); } _options = parseResult.Value; if (!String.IsNullOrEmpty(_options.OutputFileName)) { try { var filePrinter = new FilePrinter(_options.OutputFileName); _context.Printer = filePrinter; } catch (IOException ex) { Bail("Error creating output file: {0}", ex.Message); } } }