private void ParseArgument(string option, string[] args, ref int i, Arguments result) { if ("--recursive" == option || "-r" == option) { result.Recursive = true; } else if ("--monitor" == option || "-m" == option) { result.Monitor = true; } else if ("--quiet" == option || "-q" == option) { result.Quiet = true; } else if ("--event" == option || "-e" == option) { result.AddEvents(Value(args, ++i, "event").Split(',')); } else if ("--format" == option) { result.Format = TokenizeFormat(Value(args, ++i, "format")); } else if ("--exclude" == option) { result.Exclude = new Regex(Value(args, ++i, "exclude")); } else if ("--excludei" == option) { result.Exclude = new Regex(Value(args, ++i, "exclude"), RegexOptions.IgnoreCase); } else if ("--excludedirectories" == option || "-d" == option) { result.ExcludeDirectories = true; } else if (option.StartsWith("--event=")) { result.AddEvents(option.Split(new Char[] { '=' }, 2)[1].Split(',')); } else if (option.StartsWith("--format=")) { result.Format = TokenizeFormat(option.Split(new Char[] { '=' }, 2)[1]); } else if (option.StartsWith("--exclude=")) { result.Exclude = new Regex(option.Split(new Char[] { '=' }, 2)[1]); } else if (option.StartsWith("--excludei=")) { result.Exclude = new Regex(option.Split(new Char[] { '=' }, 2)[1], RegexOptions.IgnoreCase); } else if (Directory.Exists(option) || File.Exists(option)) { result.Paths.Add(System.IO.Path.GetFullPath(option)); } }
private void ParseArgument(string option, string[] args, ref int i, Arguments result) { if ("--recursive" == option || "-r" == option) { result.Recursive = true; } else if ("--monitor" == option || "-m" == option) { result.Monitor = true; } else if ("--quiet" == option || "-q" == option) { result.Quiet = true; } else if ("--event" == option || "-e" == option) { result.AddEvents(Value(args, ++i, "event").Split(',')); } else if ("--format" == option) { result.Format = TokenizeFormat(Value(args, ++i, "format")); } else if ("--exclude" == option) { result.Exclude = new Regex(Value(args, ++i, "exclude")); } else if ("--excludei" == option) { result.Exclude = new Regex(Value(args, ++i, "exclude"), RegexOptions.IgnoreCase); } else if (option.StartsWith("--event=")) { result.AddEvents(option.Split(new Char[]{'='}, 2)[1].Split(',')); } else if (option.StartsWith("--format=")) { result.Format = TokenizeFormat(option.Split(new Char[]{'='}, 2)[1]); } else if (option.StartsWith("--exclude=")) { result.Exclude = new Regex(option.Split(new Char[]{'='}, 2)[1]); } else if (option.StartsWith("--excludei=")) { result.Exclude = new Regex(option.Split(new Char[]{'='}, 2)[1], RegexOptions.IgnoreCase); } else if (Directory.Exists(option)) { result.Paths.Add(System.IO.Path.GetFullPath(option)); } }