Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
fix(cli): show the platform's default watch settle time
Blackspirits21a948cd33ae
diff --git a/src/Filee.Cli/Help.cs b/src/Filee.Cli/Help.csindex 3ec9e02f..b7c81f06 100644--- a/src/Filee.Cli/Help.cs+++ b/src/Filee.Cli/Help.cs@@ -1,6 +1,7 @@// Usage text of the "filee" command.using System.Reflection;+using Filee.Core.Watching;namespace Filee.Cli;@@ -61,7 +62,7 @@ internal static class Help""";- private const string Watch = """+ private static string Watch => FormattableString.Invariant($"""Usage: filee watch <folder> (--to <format> | --preset <preset>) [options]Converts files that land in the folder until Ctrl+C. Files are converted once they are complete (no@@ -74,10 +75,10 @@ internal static class Help-r, --recursive Also watch sub folders (their files keep the sub folder in the output)--move-originals Move converted sources to <folder>\originals; files already waiting areconverted at start- --settle <seconds> How long a file must stay unchanged (default 2)+ --settle <seconds> How long a file must stay unchanged (default {FolderWatcher.DefaultSettleTime.TotalSeconds})--keep-dates Give converted files the created and modified dates of the originals--zip Save the result of each file as one ZIP (a Shapefile's files together)--quiet Print nothing but errors- """;+ """);}diff --git a/tests/Filee.Cli.Tests/HelpTests.cs b/tests/Filee.Cli.Tests/HelpTests.csnew file mode 100644index 00000000..f18af3fb--- /dev/null+++ b/tests/Filee.Cli.Tests/HelpTests.cs@@ -0,0 +1,26 @@+// CLI help must describe the watcher's platform default without loading settings or engines.++using Filee.Core.Watching;++namespace Filee.Cli.Tests;++public sealed class HelpTests+{+ [Theory]+ [InlineData("help", "watch")]+ [InlineData("watch", "--help")]+ [InlineData("watch", "-h")]+ public async Task Watch_help_reports_the_platform_default_without_loading_engines(string command, string option)+ {+ var output = new StringWriter();+ var errors = new StringWriter();++ var code = await Cli.RunAsync([command, option], output, errors, TestContext.Current.CancellationToken,+ () => throw new InvalidOperationException("Help must not initialize engines."));++ Assert.Equal(Cli.Success, code);+ Assert.Equal("", errors.ToString());+ Assert.Contains(FormattableString.Invariant(+ $"--settle <seconds> How long a file must stay unchanged (default {FolderWatcher.DefaultSettleTime.TotalSeconds})"), output.ToString());+ }+}