-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathArgumentsHelper.cs
More file actions
42 lines (34 loc) · 1.35 KB
/
ArgumentsHelper.cs
File metadata and controls
42 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone
using BootstrapBlazorLLMsDocsGenerator;
using System.CommandLine;
namespace BootstrapBlazor.LLMsDocsGenerator;
internal static class ArgumentsHelper
{
public static ParseResult Parse(string[] args)
{
var rootFolderOption = new Option<string?>("--root") { Description = "Set the root folder of project" };
var outputFolderOption = new Option<string?>("--output") { Description = "Set the publish folder of project" };
var rootCommand = new RootCommand("BootstrapBlazor LLMs Documentation Generator")
{
rootFolderOption,
outputFolderOption
};
rootCommand.SetAction(async result =>
{
var rootFolder = result.GetValue(rootFolderOption);
if (string.IsNullOrEmpty(rootFolder))
{
return;
}
var outputFolder = result.GetValue(outputFolderOption);
if (string.IsNullOrEmpty(outputFolder))
{
return;
}
await DocsGenerator.GenerateAllAsync(rootFolder, outputFolder);
});
return rootCommand.Parse(args);
}
}