mirror of
https://github.com/nsnail/dot.git
synced 2025-12-14 16:15:47 +08:00
1.0.0
This commit is contained in:
18
src/ToolsFactory.cs
Normal file
18
src/ToolsFactory.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Dot.TrimUtf8Bom;
|
||||
|
||||
namespace Dot;
|
||||
|
||||
public static class ToolsFactory
|
||||
{
|
||||
public static ITool Create(IOption option)
|
||||
{
|
||||
return option switch {
|
||||
Option o => new Main(o)
|
||||
, Convert2Lf.Option o => new Convert2Lf.Main(o)
|
||||
, RemoveTrailingWhiteSpace.Option o => new RemoveTrailingWhiteSpace.Main(o)
|
||||
, Random.Option o => new Random.Main(o)
|
||||
, Text.Option o => new Text.Main(o)
|
||||
, _ => throw new ArgumentOutOfRangeException(nameof(option))
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user