From 183a4e8276d205a3d890c8f9a3014ca0170b990c Mon Sep 17 00:00:00 2001 From: Senn Geerts Date: Thu, 11 Jul 2024 22:53:43 +0200 Subject: [PATCH] #196 formatting --- src/AsyncAPI.Saunter.Generator.Cli/readme.md | 9 ++++++--- .../ToFile/ToFileCommandTests.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/AsyncAPI.Saunter.Generator.Cli/readme.md b/src/AsyncAPI.Saunter.Generator.Cli/readme.md index 05c4276..b5ee127 100644 --- a/src/AsyncAPI.Saunter.Generator.Cli/readme.md +++ b/src/AsyncAPI.Saunter.Generator.Cli/readme.md @@ -3,7 +3,7 @@ A dotnet tool to generate AsyncAPI specification files based of a dotnet DLL (Th ## Tool usage ``` -dotnet asyncapi tofile --output [output-path] --format [json,yml,yaml] --doc [asyncapi-document-name] [startup-assembly] +dotnet asyncapi tofile [startup-assembly] --output [output-path] --format [json,yml,yaml] --doc [asyncapi-document-name] ``` - _startup-assembly_: the file path to the entrypoint dotnet DLL that hosts AsyncAPI document(s). @@ -12,7 +12,7 @@ dotnet asyncapi tofile --output [output-path] --format [json,yml,yaml] --doc [as - _--output_: relative path where the AsyncAPI will be output [defaults to stdout] - _--filename_: the template for the outputted file names. Default: "{document}_asyncapi.{extension}" - _--format_: the output formats to generate, can be a combination of json, yml and/or yaml. -- _--env_: define environment variable(s) for the application. Formatted as a comma separated list of _key=value_ pairs or just _key_ for flags, example: ```ASPNETCORE_ENVIRONMENT=AsyncAPI,CONNECT_TO_DATABASE=false,GENERATOR_FLAG```. +- _--env_: define environment variable(s) for the application. Formatted as a comma separated list of _key=value_ pairs, example: ```ASPNETCORE_ENVIRONMENT=AsyncAPI,CONNECT_TO_DATABASE=false```. ## Install the Generator.Cli dotnet Tool ``` @@ -21,4 +21,7 @@ dotnet tool install --global AsyncAPI.Saunter.Generator.Cli After installing the tool globally, it is available using commands: ```dotnet asyncapi``` or ```dotnet-asyncapi``` Want to learn more about .NET tools? Or want to install it local using a manifest? -[Check out this Microsoft page on how to manage .NET tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) \ No newline at end of file +[Check out this Microsoft page on how to manage .NET tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools) + +## Internals +How does the tool work internally? It tries to exact an ```IServiceProvider``` from the provided _startup-assembly_ and exports AsyncApiDocument(s) as registered in the services provider. \ No newline at end of file diff --git a/test/AsyncAPI.Saunter.Generator.Cli.Tests/ToFile/ToFileCommandTests.cs b/test/AsyncAPI.Saunter.Generator.Cli.Tests/ToFile/ToFileCommandTests.cs index d879cc4..44e3c1f 100644 --- a/test/AsyncAPI.Saunter.Generator.Cli.Tests/ToFile/ToFileCommandTests.cs +++ b/test/AsyncAPI.Saunter.Generator.Cli.Tests/ToFile/ToFileCommandTests.cs @@ -99,7 +99,7 @@ public void WriteFile_DefaultParams() { var me = typeof(ToFileCommandTests).Assembly.Location; this._output.WriteLine($"Assembly: {me}"); - this._docExtractor.GetAsyncApiDocument(default, default).ReturnsForAnyArgs([(null, new AsyncApiDocument { Info = new AsyncApiInfo { Title = "a" } } )]); + this._docExtractor.GetAsyncApiDocument(default, default).ReturnsForAnyArgs([(null, new AsyncApiDocument { Info = new AsyncApiInfo { Title = "a" } })]); this._command.ToFile(me);