private static bool ValidateParameters(CommandLineParameterBase parameters) { if (!parameters.InputPaths.Any()) { Console.Error.WriteLine("No input paths specified"); return(false); } var success = true; foreach (var inputPath in parameters.InputPaths) { if (String.IsNullOrWhiteSpace(inputPath)) { Console.Error.WriteLine("Input path must not be null or whitespace"); success = false; } else if (!Directory.Exists(inputPath) && !File.Exists(inputPath)) { Console.Error.WriteLine($"Input path '{inputPath}' does not exist"); success = false; } } return(success); }
private static bool ValidateParameters(CommandLineParameterBase parameters) { if (String.IsNullOrWhiteSpace(parameters.SchemaPath)) { WriteError("ERROR: No output path specified"); return(false); } return(true); }
private static IEnumerable <string> GetAllInputFiles(CommandLineParameterBase parameters) { foreach (var inputPath in parameters.InputPaths) { if (Directory.Exists(inputPath)) { foreach (var path in Directory.GetFiles(inputPath, "*.*", SearchOption.AllDirectories)) { yield return(path); } } else if (File.Exists(inputPath)) { yield return(inputPath); } else { throw new FileNotFoundException($"Input path '{inputPath}' does not exist"); } } }
protected internal CrmToolBase(CommandLineParameterBase commandLineParameterBase, string[] args) : base(commandLineParameterBase, args) { }