Matthias77.CliUi 1.1.19

dotnet add package Matthias77.CliUi --version 1.1.19
NuGet\Install-Package Matthias77.CliUi -Version 1.1.19
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Matthias77.CliUi" Version="1.1.19" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Matthias77.CliUi --version 1.1.19
#r "nuget: Matthias77.CliUi, 1.1.19"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Matthias77.CliUi as a Cake Addin
#addin nuget:?package=Matthias77.CliUi&version=1.1.19

// Install Matthias77.CliUi as a Cake Tool
#tool nuget:?package=Matthias77.CliUi&version=1.1.19

CliUI - a simplified command line (interface) user interface

How does it work

It maintains a dictionary with complete command lines as keys and actions/priority as values. New commands can be added as a result of a command and also commands can be removed.

When idle, the loop waits for available keypresses and then locks Console.Out. If a lock can be obtained, it will read a line from input. The user can enter an arbitrary sequence of characters, which then get matched against the internal stored list. If no stored command matches the list, the interface will display sorry and wait for the next input. If only one command matches, it will be executed immediately. If more commands matches, the list will be displayed with the matched characters highlighted. The user then can enter the number from that list.

Programming it

One obtains an instance of the CmdLineUi.Instance. One can then add commands using the Add function before entering CommandLoop.

Using it

First, the user might obtain an instance of the interface. Then, the Scan4Commands can be executed that searches the loaded assemblies for public static void XX() with the custom attribute CmdLine. Functions with the CmdLineAdder can be used to add several dynamically created commands.

Then, executing CommandLoop will enter a loop that only the Exit Phrase will end.

Locking Console.Out

Background jobs must not interfere with a user dialog from another command. Hence, output should only happen, when the user interface is idle.

A lock might be obtained, once the UI is idle again. But then the keystrokes might have been used and nothing needs to be processed.

Paging and user responses

When listing larger content, the function Pager can be invoked after each line. When enough rows were displayed, it waits for user interaction. Just pressing Enter continues with the display. Everything else raises a CmdLineInterrupt with the list of words in Words and numbers in Numbers. One can specify a range of numbers <lower end>-<upper end>, which gets translated into a list of integers.

Debugging

The public field Debug increases verbosity.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.19 233 10/23/2023
1.1.18 109 10/18/2023
1.1.17 118 10/11/2023
1.1.16 125 10/6/2023
1.1.15 117 10/2/2023
1.1.14 109 9/30/2023
1.1.13 104 9/23/2023
1.1.12 97 9/23/2023
1.1.11 98 9/23/2023
1.1.10 109 9/23/2023
1.1.9 117 9/23/2023
1.1.8 115 9/23/2023
1.1.7 103 9/23/2023
1.1.6 113 9/23/2023
1.1.5 111 9/23/2023
1.1.4 103 9/19/2023
1.1.3 101 9/18/2023
1.1.2 106 9/18/2023
1.1.1 105 9/18/2023
1.1.0 109 9/18/2023
1.0.18 127 9/15/2023
1.0.17 119 9/15/2023
1.0.16 119 9/11/2023
1.0.15 109 9/11/2023
1.0.14 131 9/9/2023
1.0.13 119 9/9/2023
1.0.12 116 9/6/2023
1.0.11 112 9/3/2023
1.0.10 119 9/2/2023