Skip to content
ConsoleMonster
Class

HelpSyntaxParameter

ConsoleMonster.Help

Namespace
ConsoleMonster.Help
Assembly
ConsoleMonster
Modifiers
sealed

A parameter as it appears in a syntax line.

Inheritance

  • object
  • HelpSyntaxParameter

Usage

Explore 21 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 12

Constructors

public HelpSyntaxParameter(string name) #

Creates a syntax parameter.

Parameters

name string required
The supplied name. With Named enabled the renderer adds one dash; use -output to display --output.

Properties

public string Name { get; } #

The supplied name. With Named enabled the renderer adds one dash; use -output to display --output.

public string? Type { get; set; } #

The value type (for example string[]), or null for a switch.

public bool Required { get; set; } #

Whether it is required.

public bool Positional { get; set; } #

Whether its name may be left out (a position is given).

public bool Named { get; set; } #

Whether the syntax includes a name with one renderer-added dash (default true). Supply -output for --output. False renders only the positional value placeholder.

Extension Methods

public static HelpSyntaxParameter Named(HelpSyntaxParameter helpSyntaxParameter, bool value = true) #

Sets HelpSyntaxParameter.Named: Whether the syntax includes a name with one renderer-added dash (default true). Supply -output for --output. False renders only the positional value placeholder.

Parameters

helpSyntaxParameter ConsoleMonster.Help.HelpSyntaxParameter required
The instance.
value bool = true optional
The value; true when omitted.

Returns

HelpSyntaxParameter The same instance.

Examples

// C# initializer or property         // C# fluent
helpSyntaxParameter.Named = value;    helpSyntaxParameter.Named(value);
public static HelpSyntaxParameter Positional(HelpSyntaxParameter helpSyntaxParameter, bool value = true) #

Sets HelpSyntaxParameter.Positional: Whether its name may be left out (a position is given).

Parameters

helpSyntaxParameter ConsoleMonster.Help.HelpSyntaxParameter required
The instance.
value bool = true optional
The value; true when omitted.

Returns

HelpSyntaxParameter The same instance.

Examples

// C# initializer or property              // C# fluent
helpSyntaxParameter.Positional = value;    helpSyntaxParameter.Positional(value);
public static HelpSyntaxParameter Required(HelpSyntaxParameter helpSyntaxParameter, bool value = true) #

Sets HelpSyntaxParameter.Required: Whether it is required.

Parameters

helpSyntaxParameter ConsoleMonster.Help.HelpSyntaxParameter required
The instance.
value bool = true optional
The value; true when omitted.

Returns

HelpSyntaxParameter The same instance.

Examples

// C# initializer or property            // C# fluent
helpSyntaxParameter.Required = value;    helpSyntaxParameter.Required(value);
public static HelpSyntaxParameter Type(HelpSyntaxParameter helpSyntaxParameter, string? value) #

Sets HelpSyntaxParameter.Type: The value type (for example string[]), or null for a switch.

Parameters

helpSyntaxParameter ConsoleMonster.Help.HelpSyntaxParameter required
The instance.
value string? required
The value.

Returns

HelpSyntaxParameter The same instance.

Examples

// C# initializer or property        // C# fluent
helpSyntaxParameter.Type = value;    helpSyntaxParameter.Type(value);