diff --git a/Client/CommandOptions.cs b/Client/CommandOptions.cs index ca63058..7b39108 100644 --- a/Client/CommandOptions.cs +++ b/Client/CommandOptions.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq.Expressions; using CommandLine; using CommandLine.Text; @@ -34,6 +33,9 @@ public class CommandOptions [Option('t', "delay", Default = 0, Required = false, HelpText = "Delays copy operation for a given time in milliseconds.")] public int Delay { get; set; } + [Option('r', "recursive", Default = false, Required = false, HelpText = "Search in subdirectories.")] + public bool Recursive { get; set; } + [Usage] public static IEnumerable Examples => new List() { diff --git a/Client/FileWatcher.cs b/Client/FileWatcher.cs index 487d35a..d76d6df 100644 --- a/Client/FileWatcher.cs +++ b/Client/FileWatcher.cs @@ -20,6 +20,7 @@ public void Watch(CommandOptions options) Path = options.SourceDirectoryPath, NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName, Filter = options.FileGlobPattern, + IncludeSubdirectories = options.Recursive }; watcher.Changed += (sender, args) =>