File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/DotNetCampus.CommandLine.Analyzer/Generators Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ namespace {{model.Namespace}};
75
75
/// <summary>
76
76
/// 辅助 <see cref="{{ model . CommandObjectType . ToGlobalDisplayString ( ) }} "/> 生成命令行选项、谓词或处理函数的创建。
77
77
/// </summary>
78
- internal sealed class {{ model . GetBuilderTypeName ( ) }}
78
+ {{ ( model . IsPublic ? "public" : " internal" ) }} sealed class {{ model . GetBuilderTypeName ( ) }}
79
79
{
80
80
public static object CreateInstance(global::DotNetCampus.Cli.CommandLine commandLine)
81
81
{
Original file line number Diff line number Diff line change @@ -81,11 +81,13 @@ public static IncrementalValuesProvider<CommandObjectGeneratingModel> SelectComm
81
81
82
82
var @namespace = typeSymbol . ContainingNamespace . ToDisplayString ( ) ;
83
83
var verbName = attribute ? . ConstructorArguments [ 0 ] . Value ? . ToString ( ) ;
84
+ var isPublic = typeSymbol . DeclaredAccessibility == Accessibility . Public ;
84
85
85
86
return new CommandObjectGeneratingModel
86
87
{
87
88
Namespace = @namespace ,
88
89
CommandObjectType = typeSymbol ,
90
+ IsPublic = isPublic ,
89
91
VerbName = verbName ,
90
92
IsHandler = isHandler ,
91
93
OptionProperties = optionProperties ,
@@ -132,6 +134,8 @@ internal record CommandObjectGeneratingModel
132
134
133
135
public required INamedTypeSymbol CommandObjectType { get ; init ; }
134
136
137
+ public required bool IsPublic { get ; init ; }
138
+
135
139
public required string ? VerbName { get ; init ; }
136
140
137
141
public required bool IsHandler { get ; init ; }
You can’t perform that action at this time.
0 commit comments