Repository navigation
Expand file tree
/
Copy pathRunCommandParseResult.cs
More file actions
63 lines (52 loc) · 1.99 KB
/
Copy pathRunCommandParseResult.cs
File metadata and controls
63 lines (52 loc) · 1.99 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
namespace NETworkManager.Models.RunCommand;
/// <summary>
/// Result of <see cref="RunCommandParser.Parse" />.
/// </summary>
public sealed class RunCommandParseResult
{
/// <summary>
/// Command that matches the first word, or null if there is none.
/// </summary>
public RunCommandDefinition Command { get; init; }
/// <summary>
/// First word as typed.
/// </summary>
public string CommandText { get; init; } = string.Empty;
/// <summary>
/// Target (e.g. "10.0.0.1;10.0.0.2"), or null if there is none.
/// </summary>
public string Target { get; init; }
/// <summary>
/// Name of the profile ("@name"), or null if no profile is used. Empty if only "@" was typed.
/// </summary>
public string ProfileName { get; init; }
/// <summary>
/// Second argument (e.g. ports or DNS server), or null if there is none.
/// </summary>
public string Argument { get; init; }
/// <summary>
/// Type keyword in lowercase (e.g. "aaaa"), or null if there is none.
/// </summary>
public string Type { get; init; }
/// <summary>
/// Part of the input that is being typed.
/// </summary>
public RunCommandPosition Position { get; init; }
/// <summary>
/// Word that is being typed (empty after a space), used to filter the suggestions.
/// </summary>
public string CurrentWord { get; init; } = string.Empty;
/// <summary>
/// Input without the word that is being typed (e.g. "dns borntoberoot.net " for "dns borntoberoot.net aa"),
/// used to complete a suggestion.
/// </summary>
public string InputBeforeCurrentWord { get; init; } = string.Empty;
/// <summary>
/// Error, if the input can't be run.
/// </summary>
public RunCommandParseError Error { get; init; }
/// <summary>
/// Value the error refers to (e.g. the unknown command or argument).
/// </summary>
public string ErrorValue { get; init; }
}