Skip to content

feat(command): add option to include subdirectories #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Client/CommandOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq.Expressions;
using CommandLine;
using CommandLine.Text;

Expand Down Expand Up @@ -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<Example> Examples => new List<Example>()
{
Expand Down
1 change: 1 addition & 0 deletions Client/FileWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down