mirror of
https://github.com/nsnail/dot.git
synced 2025-06-17 21:13:21 +08:00
<feat> + git目录检索深度
This commit is contained in:
parent
e9e94460a9
commit
0e2a8237d0
@ -75,7 +75,14 @@ public class Main : ToolBase<Option>
|
||||
StashCurorPos();
|
||||
|
||||
var tAnimate = LoadingAnimate(_cursorPosBackup.x, _cursorPosBackup.y, out var cts);
|
||||
_repoPathList = Directory.GetDirectories(Opt.Path, ".git", SearchOption.AllDirectories)
|
||||
_repoPathList = Directory.GetDirectories(Opt.Path, ".git" //
|
||||
, new EnumerationOptions //
|
||||
{
|
||||
MaxRecursionDepth = Opt.MaxRecursionDepth
|
||||
, RecurseSubdirectories = true
|
||||
, IgnoreInaccessible = true
|
||||
, AttributesToSkip = FileAttributes.ReparsePoint
|
||||
})
|
||||
.Select(x => Directory.GetParent(x)!.FullName)
|
||||
.ToList();
|
||||
cts.Cancel();
|
||||
|
@ -10,6 +10,10 @@ public class Option : OptionBase
|
||||
, ResourceType = typeof(Str))]
|
||||
public string GitOutputEncoding { get; set; }
|
||||
|
||||
[Option('d', "max-recursion-depth", HelpText = nameof(Str.MaxRecursionDepth), Default = int.MaxValue
|
||||
, ResourceType = typeof(Str))]
|
||||
public int MaxRecursionDepth { get; set; }
|
||||
|
||||
[Value(0, HelpText = nameof(Str.FolderPath), Default = ".", ResourceType = typeof(Str))]
|
||||
public string Path { get; set; }
|
||||
}
|
@ -152,4 +152,7 @@
|
||||
<data name="GitOutputEncoding" xml:space="preserve">
|
||||
<value>Git output encoding</value>
|
||||
</data>
|
||||
<data name="MaxRecursionDepth" xml:space="preserve">
|
||||
<value>Directory search depth</value>
|
||||
</data>
|
||||
</root>
|
@ -60,6 +60,9 @@
|
||||
<data name="GitOutputEncoding" xml:space="preserve">
|
||||
<value>Git输出编码</value>
|
||||
</data>
|
||||
<data name="MaxRecursionDepth" xml:space="preserve">
|
||||
<value>目录检索深度</value>
|
||||
</data>
|
||||
<data name="FileSearchPattern" xml:space="preserve">
|
||||
<value>文件通配符</value>
|
||||
</data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user