Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/SampSharp.OpenMp.Entities.Commands/Core/CommandDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@ public CommandDefinition(string name, CommandGroup? group, MethodInfo method, Pa

/// <summary>Custom metadata tags attached to this overload.</summary>
public IReadOnlyDictionary<string, string> Tags => _tags;

/// <summary>
/// Gets the value of the specified command tag, or <see langword="null"/>
/// if the tag is not present.
/// </summary>
public string? GetTag(string key)
{
ArgumentException.ThrowIfNullOrEmpty(key);
return _tags.TryGetValue(key, out var value)
? value
: null;
}
}