private static CliInput ParseInput(string[] args) { var toReturn = new CliInput(); if (args == null || args.Length <= 0 || string.IsNullOrWhiteSpace(args[0])) { return(null); } var options = args.Where(s => s.StartsWith("-")).Select(s => s.ToLowerInvariant()).ToList(); toReturn.ClearDestinationFolder = options.Contains("-c"); // start folder is expected to be the last argument. toReturn.StartFolder = Utils.MakeAbsolutePath(Environment.CurrentDirectory, args[args.Length - 1]); if (!Directory.Exists(toReturn.StartFolder)) { return(null); } return(toReturn); }
public Engine(CliInput input) { _input = input; }
private static CliInput ParseInput(string[] args) { var toReturn = new CliInput(); if(args == null || args.Length <= 0 || string.IsNullOrWhiteSpace(args[0])) { return null; } var options = args.Where(s=>s.StartsWith("-")).Select(s=>s.ToLowerInvariant()).ToList(); toReturn.ClearDestinationFolder = options.Contains("-c"); // start folder is expected to be the last argument. toReturn.StartFolder = Utils.MakeAbsolutePath(Environment.CurrentDirectory, args[args.Length-1]); if(!Directory.Exists(toReturn.StartFolder)) { return null; } return toReturn; }