@@ -21,23 +21,45 @@ static async Task<int> Main(string[] args)
21
21
} ;
22
22
validateCommand . Handler = CommandHandler . Create < string > ( OpenApiService . ValidateOpenApiDocument ) ;
23
23
24
+ // transform command options
24
25
var descriptionOption = new Option ( "--openapi" , "Input OpenAPI description file path or URL" , typeof ( string ) ) ;
25
26
descriptionOption . AddAlias ( "-d" ) ;
26
27
27
28
var outputOption = new Option ( "--output" , "The output directory path for the generated file." , typeof ( FileInfo ) , ( ) => "./output" , arity : ArgumentArity . ZeroOrOne ) ;
28
- outputOption . AddAlias ( "o" ) ;
29
+ outputOption . AddAlias ( "-o" ) ;
30
+
31
+ var versionOption = new Option ( "--version" , "OpenAPI specification version" , typeof ( OpenApiSpecVersion ) ) ;
32
+ versionOption . AddAlias ( "-v" ) ;
33
+
34
+ var formatOption = new Option ( "--format" , "File format" , typeof ( OpenApiFormat ) ) ;
35
+ formatOption . AddAlias ( "-f" ) ;
36
+ ;
37
+ var inlineOption = new Option ( "--inline" , "Inline $ref instances" , typeof ( bool ) ) ;
38
+ inlineOption . AddAlias ( "-i" ) ;
39
+ ;
40
+ var resolveExternalOption = new Option ( "--resolveExternal" , "Resolve external $refs" , typeof ( bool ) ) ;
41
+ resolveExternalOption . AddAlias ( "-ex" ) ;
42
+ ;
43
+ var filterByOperationIdsOption = new Option ( "--filterByOperationIds" , "Filters OpenApiDocument by OperationId(s) provided" , typeof ( string ) ) ;
44
+ filterByOperationIdsOption . AddAlias ( "-op" ) ;
45
+ ;
46
+ var filterByTagsOption = new Option ( "--filterByTags" , "Filters OpenApiDocument by Tag(s) provided" , typeof ( string ) ) ;
47
+ filterByTagsOption . AddAlias ( "-t" ) ;
48
+ ;
49
+ var filterByCollectionOption = new Option ( "--filterByCollection" , "Filters OpenApiDocument by Postman collection provided" , typeof ( string ) ) ;
50
+ filterByCollectionOption . AddAlias ( "-c" ) ;
29
51
30
52
var transformCommand = new Command ( "transform" )
31
53
{
32
54
descriptionOption ,
33
55
outputOption ,
34
- new Option ( "--version" , "OpenAPI specification version" , typeof ( OpenApiSpecVersion ) ) ,
35
- new Option ( "--format" , "File format" , typeof ( OpenApiFormat ) ) ,
36
- new Option ( "--inline" , "Inline $ref instances" , typeof ( bool ) ) ,
37
- new Option ( "--resolveExternal" , "Resolve external $refs" , typeof ( bool ) ) ,
38
- new Option ( "--filterByOperationIds" , "Filters OpenApiDocument by OperationId(s) provided" , typeof ( string ) ) ,
39
- new Option ( "--filterByTags" , "Filters OpenApiDocument by Tag(s) provided" , typeof ( string ) ) ,
40
- new Option ( "--filterByCollection" , "Filters OpenApiDocument by Postman collection provided" , typeof ( string ) )
56
+ versionOption ,
57
+ formatOption ,
58
+ inlineOption ,
59
+ resolveExternalOption ,
60
+ filterByOperationIdsOption ,
61
+ filterByTagsOption ,
62
+ filterByCollectionOption
41
63
} ;
42
64
transformCommand . Handler = CommandHandler . Create < string , FileInfo , OpenApiSpecVersion ? , OpenApiFormat ? , string , string , string , bool , bool > (
43
65
OpenApiService . ProcessOpenApiDocument ) ;
0 commit comments