ShellDialect Class
Identifies a shell dialect understood by ShellSyntaxTree.
public sealed class ShellDialectRemarks
The set of dialects is closed. Use the static properties to obtain an instance.
Properties
| Name | Description |
|---|---|
| Bash | The GNU Bourne-Again shell (bash). |
| Cmd | The Windows command interpreter (cmd.exe). |
| Family | The grammar family the dialect belongs to. |
| Features | The optional syntax constructs the dialect supports. |
| Name | The canonical lowercase name of the dialect, such as bash or pwsh. |
| PowerShell | Windows PowerShell 5.1. |
| PowerShellCore | PowerShell Core 7 and later (pwsh). |
| Sh | The POSIX shell (sh). The strict baseline of the POSIX family. |
| Zsh | The Z shell (zsh). |
Bash
ShellDialect.csFamily
ShellDialect.csFeatures
ShellDialect.csThe optional syntax constructs the dialect supports.
public ShellDialectFeatures Features { get; }Property value
Name
ShellDialect.csPowerShell
ShellDialect.csPowerShellCore
ShellDialect.csThe POSIX shell (sh). The strict baseline of the POSIX family.
public static ShellDialect Sh { get; }Property value
Methods
| Name | Description |
|---|---|
| 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.csReturns true when the dialect supports every feature in feature.
public bool HasFeature(ShellDialectFeatures feature)ToString()
ShellDialect.csTryParse(string?, ShellDialect?)
ShellDialect.csResolves 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)