Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tools/BootstrapBlazor.LLMsDocsGenerator/ArgumentsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ internal static class ArgumentsHelper
public static ParseResult Parse(string[] args)
{
var rootFolderOption = new Option<string?>("--root") { Description = "Set the root folder of project" };
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rootFolderOption should be marked as required since the code will silently fail if it's not provided. Without making this parameter required, users won't get proper command-line help indicating this is a mandatory parameter. Consider adding .IsRequired = true to the option definition to make the requirement explicit and provide better CLI usability.

Suggested change
var rootFolderOption = new Option<string?>("--root") { Description = "Set the root folder of project" };
var rootFolderOption = new Option<string?>("--root")
{
Description = "Set the root folder of project",
IsRequired = true
};

Copilot uses AI. Check for mistakes.
var outputFolderOption = new Option<string?>("--output") { Description = "Set the publish folder of project" };
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outputFolderOption should be marked as required since the code will silently fail if it's not provided. Without making this parameter required, users won't get proper command-line help indicating this is a mandatory parameter. Consider adding .IsRequired = true to the option definition to make the requirement explicit and provide better CLI usability.

Suggested change
var outputFolderOption = new Option<string?>("--output") { Description = "Set the publish folder of project" };
var outputFolderOption = new Option<string?>("--output") { Description = "Set the publish folder of project", IsRequired = true };

Copilot uses AI. Check for mistakes.

var rootCommand = new RootCommand("BootstrapBlazor LLMs Documentation Generator")
{
rootFolderOption
rootFolderOption,
outputFolderOption
};

rootCommand.SetAction(async result =>
Expand All @@ -26,7 +28,13 @@ public static ParseResult Parse(string[] args)
return;
}

await DocsGenerator.GenerateAllAsync(rootFolder);
var outputFolder = result.GetValue(outputFolderOption);
if (string.IsNullOrEmpty(outputFolder))
{
return;
}
Comment on lines +31 to +35
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the output folder parameter is missing or empty, the function silently returns without providing any feedback to the user. This creates a poor user experience as the user won't know why the tool didn't execute. Consider logging an error message or providing usage information before returning, similar to how other command-line tools behave when required parameters are missing.

Copilot uses AI. Check for mistakes.

await DocsGenerator.GenerateAllAsync(rootFolder, outputFolder);
});

return rootCommand.Parse(args);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>10.0.1</Version>
<Version>10.0.2</Version>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
4 changes: 2 additions & 2 deletions tools/BootstrapBlazor.LLMsDocsGenerator/DocsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ internal static class DocsGenerator
/// <summary>
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a breaking API change by making the output folder parameter mandatory, but the existing documentation in README.md shows that the tool can be called without parameters (e.g., 'llms-docs' or 'dotnet run --project tools/LlmsDocsGenerator'). These examples will no longer work with the new changes. The documentation should be updated to reflect that both --root and --output parameters are now required, or the parameters should be made optional with sensible defaults to maintain backward compatibility.

Suggested change
/// <summary>
/// <summary>
/// Generate all documentation files using the current directory
/// as both the root and output folder.
/// </summary>
public static Task GenerateAllAsync()
{
var currentDirectory = Directory.GetCurrentDirectory();
return GenerateAllAsync(currentDirectory, currentDirectory);
}
/// <summary>
/// Generate all documentation files using the specified root folder
/// as both the source root and the output root.
/// </summary>
public static Task GenerateAllAsync(string rootFolder)
{
return GenerateAllAsync(rootFolder, rootFolder);
}
/// <summary>

Copilot uses AI. Check for mistakes.
/// Generate all documentation files
/// </summary>
public static async Task GenerateAllAsync(string rootFolder)
public static async Task GenerateAllAsync(string rootFolder, string outputFolder)
{
var _sourcePath = Path.Combine(rootFolder, "..", "BootstrapBlazor");
var _outputPath = Path.Combine(rootFolder, "bin", "Release", "net10.0", "publish", "wwwroot", "llms");
var _outputPath = Path.Combine(outputFolder, "wwwroot", "llms");
var _componentsOutputPath = Path.Combine(_outputPath, "components");

Logger($"Source path: {_sourcePath}");
Expand Down