Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private static bool ValidateParameters(CommandLineParameterBase parameters)
        {
            if (String.IsNullOrWhiteSpace(parameters.SchemaPath))
            {
                WriteError("ERROR: No output path specified");
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
 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");
         }
     }
 }
Esempio n. 4
0
 protected internal CrmToolBase(CommandLineParameterBase commandLineParameterBase, string[] args)
     : base(commandLineParameterBase, args)
 {
 }