@@ -11,47 +11,55 @@ namespace KubeOps.Cli;
11
11
12
12
internal static class Options
13
13
{
14
- public static readonly Option < OutputFormat > OutputFormat = new (
15
- "--format" ,
16
- ( ) => Output . OutputFormat . Yaml ,
17
- "The format of the generated output." ) ;
18
-
19
- public static readonly Option < string ? > OutputPath = new (
20
- "--out" ,
21
- "The path the command will write the files to. If omitted, prints output to console." ) ;
22
-
23
- public static readonly Option < string ? > TargetFramework = new (
24
- [ "--target-framework" , "--tfm" ] ,
25
- description : "Target framework of projects in the solution to search for entities. " +
26
- "If omitted, the newest framework is used." ) ;
27
-
28
- public static readonly Option < Regex ? > SolutionProjectRegex = new (
29
- "--project" ,
30
- parseArgument : result =>
14
+ public static readonly Option < OutputFormat > OutputFormat = new ( "--format" )
15
+ {
16
+ Description = "The format of the generated output." ,
17
+ DefaultValueFactory = _ => Output . OutputFormat . Yaml ,
18
+ } ;
19
+
20
+ public static readonly Option < string ? > OutputPath = new ( "--out" )
21
+ {
22
+ Description = "The path the command will write the files to. If omitted, prints output to console." ,
23
+ } ;
24
+
25
+ public static readonly Option < string ? > TargetFramework = new ( "--target-framework" , "--tfm" )
26
+ {
27
+ Description = "Target framework of projects in the solution to search for entities. " +
28
+ "If omitted, the newest framework is used." ,
29
+ } ;
30
+
31
+ public static readonly Option < Regex ? > SolutionProjectRegex = new ( "--project" )
32
+ {
33
+ Description = "Regex pattern to filter projects in the solution to search for entities. " +
34
+ "If omitted, all projects are searched." ,
35
+ CustomParser = result =>
31
36
{
32
37
var value = result . Tokens . Single ( ) . Value ;
33
38
return new Regex ( value ) ;
34
39
} ,
35
- description : "Regex pattern to filter projects in the solution to search for entities. " +
36
- "If omitted, all projects are searched." ) ;
37
-
38
- public static readonly Option < bool > Force = new (
39
- [ "--force" , "-f" ] ,
40
- ( ) => false ,
41
- description : "Do not bother the user with questions and just do it." ) ;
42
-
43
- public static readonly Option < bool > ClearOutputPath = new (
44
- [ "--clear-out" ] ,
45
- ( ) => false ,
46
- description : "Clear the output path before generating resources." ) ;
47
-
48
- public static readonly Option < string > AccessibleDockerImage = new (
49
- "--docker-image" ,
50
- ( ) => "accessible-docker-image" ,
51
- description : "An accessible docker image to deploy" ) ;
52
-
53
- public static readonly Option < string > AccessibleDockerTag = new (
54
- "--docker-image-tag" ,
55
- ( ) => "latest" ,
56
- description : "Tag for an accessible docker image to deploy" ) ;
40
+ } ;
41
+
42
+ public static readonly Option < bool > Force = new ( "--force" , "-f" )
43
+ {
44
+ Description = "Do not bother the user with questions and just do it." ,
45
+ DefaultValueFactory = _ => false ,
46
+ } ;
47
+
48
+ public static readonly Option < bool > ClearOutputPath = new ( "--clear-out" )
49
+ {
50
+ Description = "Clear the output path before generating resources." ,
51
+ DefaultValueFactory = _ => false ,
52
+ } ;
53
+
54
+ public static readonly Option < string > AccessibleDockerImage = new ( "--docker-image" )
55
+ {
56
+ Description = "An accessible docker image to deploy." ,
57
+ DefaultValueFactory = _ => "accessible-docker-image" ,
58
+ } ;
59
+
60
+ public static readonly Option < string > AccessibleDockerTag = new ( "--docker-image-tag" )
61
+ {
62
+ Description = "Tag for an accessible docker image to deploy." ,
63
+ DefaultValueFactory = _ => "latest" ,
64
+ } ;
57
65
}
0 commit comments