Skip to content

Commit 87cdd74

Browse files
authored
Merge pull request #107 from hiddenblue/master
Fix the args parser logical problem in MakeParameters
2 parents 0a6964c + 8e66e2b commit 87cdd74

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

README.zh-CN.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77

88
**README.md 版本修订历史**
99

10-
| 版本 | 提交 | 备注 |
11-
| --------| ------ |---------|
10+
| 版本 | 提交 | 备注 |
11+
| --------| ------ |-----------------------------------|
12+
| 1.1 | [e73b4fe](https://github.com/pierre3/PlantUmlClassDiagramGenerator/commit/e73b4feed9cd261271eb990a9c859f53536e8d7c) | 新增 "-excludeUmlBeginEndTags" 参数选项 |
1213
| 1.0 | [70bb820](https://github.com/pierre3/PlantUmlClassDiagramGenerator/commit/70bb8202f7f489aa2d85ce9c25c58121c8f63aed) | 因为其它语言的README.md不一定同时更新,所以需要一个版本号 |
1314

15+
## Roslyn Source Generator
16+
类图由 Roslyn 源代码生成器自动生成。详细信息请参见以下链接。
17+
- [PlantUmlClassDiagramGenerator.SourceGenerator](/src/PlantUmlClassDiagramGenerator.SourceGenerator)
18+
1419
## Visual Studio Code 扩展
1520

1621
- [C# to PlantUML](https://marketplace.visualstudio.com/items?itemName=pierre3.csharp-to-plantuml)
@@ -20,7 +25,7 @@
2025
Nuget Gallery: https://www.nuget.org/packages/PlantUmlClassDiagramGenerator
2126

2227
### 安装
23-
下载并安装[.NET 6.0 SDK](https://www.microsoft.com/net/download/windows)或更新的版本。安装后,运行以下命令。
28+
下载并安装[.NET 8.0 SDK](https://www.microsoft.com/net/download/windows)或更新的版本。安装后,运行以下命令。
2429

2530
```bat
2631
dotnet tool install --global PlantUmlClassDiagramGenerator
@@ -39,10 +44,12 @@ puml-gen InputPath [OutputPath] [-dir] [-public | -ignore IgnoreAccessibilities]
3944
- -public: (可选) 如果指定,只输出公共可及性成员。
4045
- -ignore: (可选) 指定要忽略的成员的可访问性,用逗号分隔的列表。
4146
- -excludePaths: (可选) 指定排除的文件和目录。
42-
指定来自 "InputPath "的相对路径,用逗号分隔的列表。
47+
指定来自 "InputPath "的相对路径,用逗号分隔的列表。
48+
要排除包含特定文件夹名称的多个路径,请在名称前加上 "\*\*/"。示例:"**/bin"
4349
- -createAssociation: (可选) 从字段和属性的引用中创建对象关联。
4450
- -allInOne: (可选) 只有当-dir被设置时:将所有图表的输出复制到文件include.puml(这允许PlanUMLServer渲染)。
4551
- -attributeRequired: (可选) 当这个开关被启用时,只有类型声明中带有 "PlantUmlDiagramAttribute "的类型会被输出。
52+
- -excludeUmlBeginEndTags: (可选)当启用此开关时,它将从 puml 文件中排除 \"@startuml\"\"@enduml\"l 标签。
4653

4754
例子:
4855
```bat
@@ -66,7 +73,7 @@ puml-gen C:\Source\App1 C:\PlantUml\App1 -dir -excludePaths bin,obj,Properties
6673
|C# | PlantUML |
6774
|:----------------|-------------------:|
6875
| `class` | `class` |
69-
| `struct` | `<<struct>> class` |
76+
| `struct` | `struct` |
7077
| `interface` | `interface` |
7178
| `enum` | `enum` |
7279
| `record` | `<<record>> class` |
@@ -75,7 +82,7 @@ puml-gen C:\Source\App1 C:\PlantUml\App1 -dir -excludePaths bin,obj,Properties
7582

7683
|C# | PlantUML |
7784
|:----------------|-------------------:|
78-
| `abstract` | `abstract` |
85+
| `abstract` | `abstract` |
7986
| `static` | `<<static>>` |
8087
| `partial` | `<<partial>>` |
8188
| `sealed` | `<<sealed>>` |
@@ -109,7 +116,7 @@ enum EnumType{
109116
@startuml
110117
class ClassA {
111118
}
112-
class StructA <<struct>> {
119+
struct StructA {
113120
}
114121
interface InterfaceA {
115122
}

src/PlantUmlClassDiagramGenerator/Program.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,15 @@ private static Dictionary<string, string> MakeParameters(string[] args)
264264
parameters.Add(arg, string.Empty);
265265
}
266266
}
267-
268-
if(!parameters.TryAdd("in", arg))
267+
else
269268
{
270-
parameters.TryAdd("out", arg);
269+
if(!parameters.TryAdd("in", arg))
270+
{
271+
parameters.TryAdd("out", arg);
272+
}
271273
}
274+
275+
272276
}
273277
return parameters;
274278
}

0 commit comments

Comments
 (0)