CommandLineEditors 0.2.2
See the version list below for details.
dotnet add package CommandLineEditors --version 0.2.2
NuGet\Install-Package CommandLineEditors -Version 0.2.2
<PackageReference Include="CommandLineEditors" Version="0.2.2" />
paket add CommandLineEditors --version 0.2.2
#r "nuget: CommandLineEditors, 0.2.2"
// Install CommandLineEditors as a Cake Addin #addin nuget:?package=CommandLineEditors&version=0.2.2 // Install CommandLineEditors as a Cake Tool #tool nuget:?package=CommandLineEditors&version=0.2.2
CommandLineEditors Library
This library provides editors for the command line that can be used as a replacement for the standard System.Console.ReadLine() method call.
Currently there is only one line-editor fully implemented, which emulates the ReadLine library, similar to a Emacs key-binding.
An early version of VI key-bindings is also in this library at the current state, but we do not recommend using this.
Quick Start
If you just want to get a replacement of the C# standard function Console.ReadLine() the ReadLineEditor is probably the best way to start with. It provides a key-binding which implements 95% of the well-known readline-libray key kindings people usually encounter on terminals in Linux.
To start with this editor, you have to add one using-statement and also create an instance of this editor, because the editor holds a history of what the user typed to make it available throught the up and down-arrow keys.
Here is a small program which repeatedly reads a single line from the console until the user enters an empty line:
using CommandLineEditors.Editor.ReadLine;
namespace CommandLineEditors.Demo
{
internal class Program
{
private static void Main(string[] args)
{
TestConsoleInput();
}
public static void TestConsoleInput()
{
ReadLineEditor readLineInterface = new ReadLineEditor();
string result = "-not-empty-to-start-with-";
while (!string.IsNullOrEmpty(result))
{
System.Console.Write("> ");
result = readLineInterface.ReadLine();
System.Console.WriteLine();
System.Console.WriteLine($"result: '{result}'");
}
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Theraot.Core (>= 3.2.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.