/// <summary> /// Parses the given command line and sets new command line arguments. /// </summary> protected CommandLineArguments SetArguments(string commandLine) { // Command line options have changed, so update options with new parsed CommandLineArguments. var splitArguments = CommandLineParser.SplitCommandLineIntoArguments(commandLine, removeHashComments: false); var parsedCommandLineArguments = CommandLineParserService?.Parse(splitArguments, this.ContainingDirectoryPathOpt, isInteractive: false, sdkDirectory: null); SetArgumentsCore(commandLine, parsedCommandLineArguments); return(parsedCommandLineArguments); }
private static void Main(string[] args) { IGpxReader gpxReader = new GpxReader(); IKmlWriter kmlWriter = new KmlWriter(); ICommandLineParserService commandLineParserService = new CommandLineParserService(); IGpxToKmlConverter gpxToKmlConverter = new GpxToKmlConverter(commandLineParserService, gpxReader, kmlWriter); gpxToKmlConverter.Run(args); }
/// <summary> /// If the command line has changed from the last parsed command line, then it parses it and sets new command line arguments. /// </summary> /// <param name="commandlineForOptions"></param> /// <returns></returns> protected CommandLineArguments SetArguments(string commandlineForOptions) { if (!string.Equals(_lastParsedCompilerOptions, commandlineForOptions, StringComparison.OrdinalIgnoreCase)) { // Command line options have changed, so update options with new parsed CommandLineArguments. var splitArguments = CommandLineParser.SplitCommandLineIntoArguments(commandlineForOptions, removeHashComments: false); _lastParsedCommandLineArguments = CommandLineParserService?.Parse(splitArguments, this.ContainingDirectoryPathOpt, isInteractive: false, sdkDirectory: null); _lastParsedCompilerOptions = commandlineForOptions; } return(_lastParsedCommandLineArguments); }