Skip to content

Commit

Permalink
fix: cleanup commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Rast1234 committed Jan 18, 2024
1 parent 7cdc841 commit 2bac205
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 88 deletions.
1 change: 0 additions & 1 deletion src/SyncFaction.Toolbox/Archiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public async Task Unpack(UnpackSettings settings, CancellationToken token)
foreach (var x in batch.Where(x => !runningTasks.ContainsKey(x)))
{
runningTasks.Add(x, UnpackArchive(x, cts.Token));
log.LogDebug("Started new task, running {running}, args {args}", runningTasks.Count, x);
}
var completed = await Task.WhenAny(runningTasks.Values);
var result = await completed;
Expand Down
1 change: 0 additions & 1 deletion src/SyncFaction.Toolbox/Args/AppRootCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public AppRootCommand()
AddCommand(new Unpeg());
AddCommand(new Repeg());
//AddCommand(new Pack());
AddCommand(new Get());
}

public class CommandHandler : ICommandHandler
Expand Down
49 changes: 0 additions & 49 deletions src/SyncFaction.Toolbox/Args/Get.cs

This file was deleted.

31 changes: 0 additions & 31 deletions src/SyncFaction.Toolbox/Args/Pack.cs

This file was deleted.

9 changes: 4 additions & 5 deletions src/SyncFaction.Toolbox/Args/Unpack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace SyncFaction.Toolbox.Args;
public class Unpack : Command
{
private readonly Argument<string> archiveArg = new("archive", "vpp or peg archive to unpack, globs allowed");
private readonly Argument<string> fileArg = new("file", () => "*", "file inside archive to extract, globs allowed");
private readonly Argument<string> fileArg = new("file", () => "*", "file inside archive to extract, globs allowed. lookup is not recursive!");
private readonly Argument<string> outputArg = new("output", () => Archiver.DefaultDir, "output path");

private readonly Option<bool> xmlFormat = new(new[]
Expand All @@ -33,11 +33,10 @@ public class Unpack : Command
"-t",
"--textures"
},
() => new List<Archiver.TextureFormat>(),
$"unpack textures from containers (.cpeg_pc .cvbm_pc .gpeg_pc .gvbm_pc) in {Archiver.DefaultDir} subfolder. Specify one or more supported formats: dds png raw")
{
ArgumentHelpName = "formats",
AllowMultipleArgumentsPerToken = true
AllowMultipleArgumentsPerToken = true,
};

private readonly Option<bool> metadata = new(new[]
Expand All @@ -64,7 +63,7 @@ public class Unpack : Command
ArgumentHelpName = "N"
};

public override string? Description => @"Extract archive to dir
public override string? Description => @"Extract archives and containers
Supported formats: " + string.Join(" ", Archiver.KnownArchiveExtensions.Concat(Archiver.KnownTextureArchiveExtensions));

public Unpack() : base(nameof(Unpack).ToLowerInvariant())
Expand All @@ -89,7 +88,7 @@ private async Task<int> Handle(InvocationContext context, CancellationToken toke
var output = context.ParseResult.GetValueForArgument(outputArg);
var xmlFormat = context.ParseResult.GetValueForOption(this.xmlFormat);
var recursive = context.ParseResult.GetValueForOption(this.recursive);
var textures = context.ParseResult.GetValueForOption(this.textures);
var textures = context.ParseResult.GetValueForOption(this.textures) ?? new List<Archiver.TextureFormat>();
var metadata = context.ParseResult.GetValueForOption(this.metadata);
var force = context.ParseResult.GetValueForOption(this.force);
var parallel = context.ParseResult.GetValueForOption(this.parallel);
Expand Down
2 changes: 1 addition & 1 deletion src/SyncFaction.Toolbox/Args/Unpeg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Unpeg : Command
},
"overwrite output if exists");

public Unpeg() : base(nameof(Unpeg).ToLowerInvariant(), "TEST: debug peg info and image conversions")
public Unpeg() : base(nameof(Unpeg).ToLowerInvariant(), "TEST TODO: debug compare dds and png")
{
AddArgument(pathArg);
//AddArgument(outputArg);
Expand Down

0 comments on commit 2bac205

Please sign in to comment.