-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommandMatch.cs
More file actions
40 lines (35 loc) · 1.2 KB
/
CommandMatch.cs
File metadata and controls
40 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Collections.Generic;
using System.Collections.Immutable;
using Ultz.Extensions.Commands.Built;
namespace Ultz.Extensions.Commands.Mapping
{
/// <summary>
/// Represents a found <see cref="Built.Command" />, the path to it, and raw arguments.
/// </summary>
public sealed class CommandMatch
{
internal CommandMatch(Command command, string alias, IReadOnlyList<string> path, string rawArguments)
{
Command = command;
Alias = alias;
Path = path.ToImmutableArray();
RawArguments = rawArguments;
}
/// <summary>
/// Gets the found <see cref="Built.Command" />.
/// </summary>
public Command Command { get; }
/// <summary>
/// Gets the matched alias.
/// </summary>
public string Alias { get; }
/// <summary>
/// Gets the alias path to the found <see cref="Built.Command" /> in the order they were matched.
/// </summary>
public IReadOnlyList<string> Path { get; }
/// <summary>
/// Gets the extracted raw arguments after the matched aliases.
/// </summary>
public string RawArguments { get; }
}
}