Share via


CommandLineBuilderExtensions.UseHelp 方法

定义

重载

UseHelp(CommandLineBuilder, Nullable<Int32>)

将应用程序配置为在命令行上指定以下选项之一时显示帮助:

-h
/h
--help
-?
/?
UseHelp(CommandLineBuilder, String[])

将应用程序配置为在命令行上使用指定选项别名之一时显示帮助。

UseHelp(CommandLineBuilder, Action<HelpContext>, Nullable<Int32>)

将应用程序配置为在命令行上使用指定选项别名之一时显示帮助。

UseHelp(CommandLineBuilder, Nullable<Int32>)

将应用程序配置为在命令行上指定以下选项之一时显示帮助:

-h
/h
--help
-?
/?
public static System.CommandLine.Builder.CommandLineBuilder UseHelp (this System.CommandLine.Builder.CommandLineBuilder builder, int? maxWidth = default);
static member UseHelp : System.CommandLine.Builder.CommandLineBuilder * Nullable<int> -> System.CommandLine.Builder.CommandLineBuilder
<Extension()>
Public Function UseHelp (builder As CommandLineBuilder, Optional maxWidth As Nullable(Of Integer) = Nothing) As CommandLineBuilder

参数

builder
CommandLineBuilder

命令行生成器。

maxWidth
Nullable<Int32>

默认帮助生成器的最大输出宽度。

返回

的同一 CommandLineBuilder实例。

适用于

UseHelp(CommandLineBuilder, String[])

将应用程序配置为在命令行上使用指定选项别名之一时显示帮助。

public:
[System::Runtime::CompilerServices::Extension]
 static System::CommandLine::Builder::CommandLineBuilder ^ UseHelp(System::CommandLine::Builder::CommandLineBuilder ^ builder, ... cli::array <System::String ^> ^ helpAliases);
public static System.CommandLine.Builder.CommandLineBuilder UseHelp (this System.CommandLine.Builder.CommandLineBuilder builder, params string[] helpAliases);
static member UseHelp : System.CommandLine.Builder.CommandLineBuilder * string[] -> System.CommandLine.Builder.CommandLineBuilder
<Extension()>
Public Function UseHelp (builder As CommandLineBuilder, ParamArray helpAliases As String()) As CommandLineBuilder

参数

builder
CommandLineBuilder

命令行生成器。

helpAliases
String[]

可在命令行上指定以请求帮助的别名集。

返回

的同一 CommandLineBuilder实例。

注解

指定的别名将替代默认值。

适用于

UseHelp(CommandLineBuilder, Action<HelpContext>, Nullable<Int32>)

将应用程序配置为在命令行上使用指定选项别名之一时显示帮助。

public static System.CommandLine.Builder.CommandLineBuilder UseHelp (this System.CommandLine.Builder.CommandLineBuilder builder, Action<System.CommandLine.Help.HelpContext> customize, int? maxWidth = default);
static member UseHelp : System.CommandLine.Builder.CommandLineBuilder * Action<System.CommandLine.Help.HelpContext> * Nullable<int> -> System.CommandLine.Builder.CommandLineBuilder
<Extension()>
Public Function UseHelp (builder As CommandLineBuilder, customize As Action(Of HelpContext), Optional maxWidth As Nullable(Of Integer) = Nothing) As CommandLineBuilder

参数

builder
CommandLineBuilder

命令行生成器。

customize
Action<HelpContext>

请求帮助时,将调用该委托来自定义帮助。

maxWidth
Nullable<Int32>

默认帮助生成器的最大输出宽度。

返回

的同一 CommandLineBuilder实例。

注解

指定的别名将替代默认值。

适用于