Skip to content

Commit c5df1c1

Browse files
feat: cli support filterCaseInsensitive params
1 parent 0a30ddd commit c5df1c1

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README-en_US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ $ openapi --help
192192
-f, --full <boolean> full replacement (default: true)
193193
--enableLogging <boolean> open the log (default: false)
194194
--priorityRule <string> priority rule, include/exclude/both (default: "include")
195-
--filterCaseInsensitive <boolean> whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters. (default: false)
195+
--filterCaseInsensitive <boolean> whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters (default: false)
196196
--includeTags <(string|RegExp)[]> generate code from include tags
197197
--includePaths <(string|RegExp)[]> generate code from include paths
198198
--excludeTags <(string|RegExp)[]> generate code from exclude tags
@@ -231,7 +231,7 @@ openapi -i ./spec.json -o ./apis
231231
| full | no | boolean | true | full replacement |
232232
| enableLogging | no | boolean | false | open the log |
233233
| priorityRule | no | string | 'include' | priority rule, include/exclude/both |
234-
| filterCaseInsensitive | no | boolean | false | whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters. (default: false) | |
234+
| filterCaseInsensitive | no | boolean | false | whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters |
235235
| includeTags | no | (string\|RegExp)[] | - | generate code from include tags, priorityRule=include required |
236236
| includePaths | no | (string\|RegExp)[] | - | generate code from include paths |
237237
| excludeTags | no | (string\|RegExp)[] | - | generate code from exclude tags |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ $ openapi --help
194194
-f, --full <boolean> full replacement (default: true)
195195
--enableLogging <boolean> open the log (default: false)
196196
--priorityRule <string> priority rule, include/exclude/both (default: "include")
197-
--filterCaseInsensitive <boolean> whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters. (default: false)
197+
--filterCaseInsensitive <boolean> whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters
198198
--includeTags <(string|RegExp)[]> generate code from include tags
199199
--includePaths <(string|RegExp)[]> generate code from include paths
200200
--excludeTags <(string|RegExp)[]> generate code from exclude tags
@@ -233,7 +233,7 @@ openapi --i ./spec.json --o ./apis
233233
| full || boolean | true | 是否全量替换 |
234234
| enableLogging || boolean | false | 是否开启日志 |
235235
| priorityRule || string | 'include' | 模式规则,可选include/exclude/both |
236-
| filterCaseInsensitive || boolean | false | 执行 includeTags、includePaths、excludeTags、excludePaths 过滤时是否忽略大小写 |
236+
| filterCaseInsensitive || boolean | false | 执行 includeTags、includePaths、excludeTags、excludePaths 过滤时是否忽略大小写 |
237237
| includeTags || (string\|RegExp)[] | - | 根据指定的 tags 生成代码, priorityRule=include则必填 |
238238
| includePaths || (string\|RegExp)[] | - | 根据指定的 paths 生成代码 |
239239
| excludeTags || (string\|RegExp)[] | - | 根据指定的 tags 不生成代码 |

src/bin/openapi.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ const params = program
2626
.option('-f, --full <boolean>', 'full replacement', true)
2727
.option('--enableLogging <boolean>', 'open the log', false)
2828
.option(
29-
'--priorityRule <string>',
30-
'priority rule, include/exclude/both (default: "include")'
29+
'--filterCaseInsensitive <boolean>',
30+
'whether to perform a case-insensitive match with includeTags, includePaths, excludeTags, excludePaths filters',
31+
false
32+
)
33+
.option(
34+
'--includeTags <(string|RegExp)[]>',
35+
'generate code from include tags'
3136
)
3237
.option(
3338
'--includeTags <(string|RegExp)[]>',
@@ -115,6 +120,8 @@ const baseGenerate = (_params_: OptionValues): GenerateServiceProps => {
115120
full: JSON.parse(_params_.full as string) === true,
116121
enableLogging: JSON.parse(_params_.enableLogging as string) === true,
117122
priorityRule: _params_.priorityRule as IPriorityRule,
123+
filterCaseInsensitive:
124+
JSON.parse(_params_.filterCaseInsensitive as string) === true,
118125
includeTags: _params_.includeTags as string[],
119126
includePaths: _params_.includePaths as string[],
120127
excludeTags: _params_.excludeTags as string[],

0 commit comments

Comments
 (0)