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

namespace HyperBooru.PowerShell;

[Alias("rhbtd")]
[Cmdlet(VerbsCommon.Remove, "HyperBooruTagDefinition")]
public class RemoveTagDefinitionCmdlet : SessionCmdlet {
    [Parameter(Mandatory = true)] public required Guid TagDefinitionId { get; set; }

    protected override void ProcessRecord() {
        Session.Tag.DeleteTagDefinitionAsync(TagDefinitionId)
            .GetAwaiter()
            .GetResult();

        WriteVerbose($"Removed tag definition {TagDefinitionId.ToString().ToUpper()}");
    }
}