forked from UbiquityDotNET/Ubiquity.NET.Utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpected.cs
More file actions
76 lines (68 loc) · 3.09 KB
/
expected.cs
File metadata and controls
76 lines (68 loc) · 3.09 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
64
65
66
67
68
69
70
71
72
73
74
75
76
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// testhost [18.0.1]
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#nullable enable
using static global::Ubiquity.NET.CommandLine.SymbolValidationExtensions;
namespace TestNamespace
{
internal partial class TestOptions
: global::Ubiquity.NET.CommandLine.IRootCommandBuilderWithSettings
, global::Ubiquity.NET.CommandLine.ICommandBinder<TestOptions>
{
public static global::Ubiquity.NET.CommandLine.CommandLineSettings Settings => new();
public static TestOptions Bind( global::System.CommandLine.ParseResult parseResult )
{
return new()
{
SomePath = parseResult.GetRequiredValue( Descriptors.SomePath ),
SomeExistingPath = parseResult.GetRequiredValue( Descriptors.SomeExistingPath ),
Thing1 = parseResult.GetRequiredValue( Descriptors.Thing1 ),
SomeOtherPath = parseResult.GetRequiredValue( Descriptors.SomeOtherPath ),
};
}
public static global::Ubiquity.NET.CommandLine.AppControlledDefaultsRootCommand Build( )
{
return new global::Ubiquity.NET.CommandLine.AppControlledDefaultsRootCommand( Settings, "Root command for tests" )
{
Descriptors.SomePath,
Descriptors.SomeExistingPath,
Descriptors.Thing1,
Descriptors.SomeOtherPath,
};
}
}
file static class Descriptors
{
internal static readonly global::System.CommandLine.Option<global::System.IO.DirectoryInfo> SomePath
= new global::System.CommandLine.Option<global::System.IO.DirectoryInfo>("-o")
{
Description = "Test SomePath",
}.EnsureFolder();
internal static readonly global::System.CommandLine.Option<global::System.IO.DirectoryInfo> SomeExistingPath
= new global::System.CommandLine.Option<global::System.IO.DirectoryInfo>("-b")
{
Description = "Test Some existing Path",
}.AcceptExistingFolderOnly();
internal static readonly global::System.CommandLine.Option<bool> Thing1
= new global::System.CommandLine.Option<bool>("--thing1", "-t")
{
HelpName = "Help name for thing1",
Description = "Test Thing1",
Required = true,
};
internal static readonly global::System.CommandLine.Option<global::System.IO.FileInfo> SomeOtherPath
= new global::System.CommandLine.Option<global::System.IO.FileInfo>("-a")
{
Description = "Test SomeOtherPath",
Required = false,
Hidden = true,
Arity = new global::System.CommandLine.ArgumentArity(0, 3),
}.AcceptExistingFileOnly();
}
}