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();
|
StashCurorPos();
|
||||||
|
|
||||||
var tAnimate = LoadingAnimate(_cursorPosBackup.x, _cursorPosBackup.y, out var cts);
|
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)
|
.Select(x => Directory.GetParent(x)!.FullName)
|
||||||
.ToList();
|
.ToList();
|
||||||
cts.Cancel();
|
cts.Cancel();
|
||||||
|
@ -10,6 +10,10 @@ public class Option : OptionBase
|
|||||||
, ResourceType = typeof(Str))]
|
, ResourceType = typeof(Str))]
|
||||||
public string GitOutputEncoding { get; set; }
|
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))]
|
[Value(0, HelpText = nameof(Str.FolderPath), Default = ".", ResourceType = typeof(Str))]
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
}
|
}
|
@ -152,4 +152,7 @@
|
|||||||
<data name="GitOutputEncoding" xml:space="preserve">
|
<data name="GitOutputEncoding" xml:space="preserve">
|
||||||
<value>Git output encoding</value>
|
<value>Git output encoding</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MaxRecursionDepth" xml:space="preserve">
|
||||||
|
<value>Directory search depth</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -60,6 +60,9 @@
|
|||||||
<data name="GitOutputEncoding" xml:space="preserve">
|
<data name="GitOutputEncoding" xml:space="preserve">
|
||||||
<value>Git输出编码</value>
|
<value>Git输出编码</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MaxRecursionDepth" xml:space="preserve">
|
||||||
|
<value>目录检索深度</value>
|
||||||
|
</data>
|
||||||
<data name="FileSearchPattern" xml:space="preserve">
|
<data name="FileSearchPattern" xml:space="preserve">
|
||||||
<value>文件通配符</value>
|
<value>文件通配符</value>
|
||||||
</data>
|
</data>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user