mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
32 lines
794 B
C#
32 lines
794 B
C#
using System.CommandLine;
|
|
using System.CommandLine.Invocation;
|
|
using System.CommandLine.NamingConventionBinder;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Wabbajack.CLI.Builder;
|
|
using Wabbajack.Paths;
|
|
using Wabbajack.VFS;
|
|
|
|
namespace Wabbajack.CLI.Verbs;
|
|
|
|
public class VFSIndex
|
|
{
|
|
private readonly Context _context;
|
|
|
|
public VFSIndex(Context context)
|
|
{
|
|
_context = context;
|
|
}
|
|
|
|
public static VerbDefinition Definition = new("vfs-index",
|
|
"Index and cache the contents of a folder", new[]
|
|
{
|
|
new OptionDefinition(typeof(AbsolutePath), "f", "folder", "Folder to index")
|
|
});
|
|
|
|
public async Task<int> Run(AbsolutePath folder)
|
|
{
|
|
await _context.AddRoot(folder, CancellationToken.None);
|
|
return 0;
|
|
}
|
|
} |