forked from dotnet/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelpCommandParser.cs
37 lines (26 loc) · 998 Bytes
/
HelpCommandParser.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.CommandLine;
using Microsoft.DotNet.Cli;
namespace Microsoft.DotNet.Tools.Help;
internal static class HelpCommandParser
{
public static readonly string DocsLink = "https://aka.ms/dotnet-help";
public static readonly CliArgument<string[]> Argument = new(LocalizableStrings.CommandArgumentName)
{
Description = LocalizableStrings.CommandArgumentDescription,
Arity = ArgumentArity.ZeroOrMore
};
private static readonly CliCommand Command = ConstructCommand();
public static CliCommand GetCommand()
{
return Command;
}
private static CliCommand ConstructCommand()
{
DocumentedCommand command = new("help", DocsLink, LocalizableStrings.AppFullName);
command.Arguments.Add(Argument);
command.SetAction(HelpCommand.Run);
return command;
}
}