ShellDialect Class

Identifies a shell dialect understood by ShellSyntaxTree.

public sealed class ShellDialect

Remarks

The set of dialects is closed. Use the static properties to obtain an instance.

Properties

NameDescription
BashThe GNU Bourne-Again shell (bash).
CmdThe Windows command interpreter (cmd.exe).
FamilyThe grammar family the dialect belongs to.
FeaturesThe optional syntax constructs the dialect supports.
NameThe canonical lowercase name of the dialect, such as bash or pwsh.
PowerShellWindows PowerShell 5.1.
PowerShellCorePowerShell Core 7 and later (pwsh).
ShThe POSIX shell (sh). The strict baseline of the POSIX family.
ZshThe Z shell (zsh).

The GNU Bourne-Again shell (bash).

public static ShellDialect Bash { get; }

Property value

ShellDialect

The Windows command interpreter (cmd.exe).

public static ShellDialect Cmd { get; }

Property value

ShellDialect

The grammar family the dialect belongs to.

public ShellDialectFamily Family { get; }

Property value

ShellDialectFamily

The optional syntax constructs the dialect supports.

public ShellDialectFeatures Features { get; }

Property value

ShellDialectFeatures

The canonical lowercase name of the dialect, such as bash or pwsh.

public string Name { get; }

Property value

string

PowerShell

ShellDialect.cs

Windows PowerShell 5.1.

public static ShellDialect PowerShell { get; }

Property value

ShellDialect

PowerShellCore

ShellDialect.cs

PowerShell Core 7 and later (pwsh).

public static ShellDialect PowerShellCore { get; }

Property value

ShellDialect

The POSIX shell (sh). The strict baseline of the POSIX family.

public static ShellDialect Sh { get; }

Property value

ShellDialect

The Z shell (zsh).

public static ShellDialect Zsh { get; }

Property value

ShellDialect

Methods

NameDescription
HasFeature(ShellDialectFeatures)Returns true when the dialect supports every feature in feature.
ToString()
TryParse(string?, ShellDialect?)Resolves a dialect from its name. Recognizes the canonical names and common aliases such as powershell-core.

HasFeature(ShellDialectFeatures)

ShellDialect.cs

Returns true when the dialect supports every feature in feature.

public bool HasFeature(ShellDialectFeatures feature)

Parameters

feature ShellDialectFeatures

Returns

bool

ToString()

ShellDialect.cs
public override string ToString()

Returns

string

No documentation is available.

TryParse(string?, ShellDialect?)

ShellDialect.cs

Resolves a dialect from its name. Recognizes the canonical names and common aliases such as powershell-core.

public static bool TryParse(string? name, out ShellDialect? dialect)

Parameters

name string?
dialect ShellDialect?

Returns

bool