diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-06-15 12:54:44 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-06-15 12:54:44 +1000 |
| commit | d36e27387eabf88845d364b9d3a2da54a583247f (patch) | |
| tree | 716058aac0b72c1ec1bb0b7eb47d4e3a87926299 /RemoveImplicitTag.cs | |
| parent | ab46387d4d02e30b171a7c2fa07947b41ec691a0 (diff) | |
Diffstat (limited to 'RemoveImplicitTag.cs')
| -rw-r--r-- | RemoveImplicitTag.cs | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/RemoveImplicitTag.cs b/RemoveImplicitTag.cs index 7d156ab..a76c54f 100644 --- a/RemoveImplicitTag.cs +++ b/RemoveImplicitTag.cs @@ -1,17 +1,25 @@ -using HyperBooru.ApiClient; -using System.Management.Automation; +using System.Management.Automation; namespace HyperBooru.PowerShell; [Alias("rhbit")] [Cmdlet(VerbsCommon.Remove, "HyperBooruImplicitTag")] -public class RemoveImplicitTagCmdlet : PSCmdlet { - [Parameter(Mandatory = true)] public required HBSession Session { get; set; } - [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; } - [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId { get; set; } +public class RemoveImplicitTagCmdlet : SessionCmdlet { + [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; } + [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId { get; set; } - protected override void ProcessRecord() => + protected override void ProcessRecord() { Session.Tag.DeleteImplicitTagAsync(TagDefinitionId, ImplicitTagId) .GetAwaiter() .GetResult(); + + var id = TagDefinitionId.ToString().ToUpper(); + var impl = ImplicitTagId + .Order() + .Distinct() + .Select(t => t.ToString().ToUpper()); + + WriteVerbose( + $"Removed implicit tags {string.Join(", ", impl)} from tag {id}"); + } } |
