summaryrefslogtreecommitdiff
path: root/SetImplicitTag.cs
blob: 409b975e0dfbe26e2dfb88147fed88a990d51a98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System.Management.Automation;

namespace HyperBooru.PowerShell;

[Alias("shbit")]
[Cmdlet(VerbsCommon.Set, "HyperBooruImplicitTag")]
public class SetImplicitTagCmdlet : SessionCmdlet {
    [Parameter(Mandatory = true)] public required Guid   TagDefinitionId { get; set; }
    [Parameter(Mandatory = true)] public required Guid[] ImplicitTagId   { get; set; }

    protected override void ProcessRecord() =>
        Session.Tag.ReplaceImplicitTagsAsync(TagDefinitionId, ImplicitTagId)
            .GetAwaiter()
            .GetResult();
}