Add usage instructions
This commit is contained in:
Родитель
c94c318621
Коммит
b0ca1fdd15
18
README.md
18
README.md
|
@ -4,6 +4,24 @@ A library to read compiled, binary terminfo descriptions.
|
|||
|
||||
_[![TermInfo NuGet Version](https://img.shields.io/nuget/v/TermInfo.svg?style=flat&label=NuGet%3A%20TermInfo)](https://www.nuget.org/packages/TermInfo)_
|
||||
|
||||
## Usage
|
||||
|
||||
```csharp
|
||||
// Load the active terminfo description
|
||||
var info = TermInfoDesc.Load();
|
||||
|
||||
// Load via terminfo name
|
||||
var info = TermInfoDesc.Load("xterm-256color");
|
||||
|
||||
// Default capabilities are strongly typed
|
||||
Debug.Assert(info.MaxColors == 256)
|
||||
|
||||
// But extended capabilities are also supported
|
||||
bool? ax = info.Extended.GetBoolean("AX");
|
||||
int? u8 = info.Extended.GetNum("U8");
|
||||
string? kup = info.Extended.GetNum("kUP");
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
We're using [Cake](https://github.com/cake-build/cake) as a
|
||||
|
|
Загрузка…
Ссылка в новой задаче