Matthias77.CliUi 1.1.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Matthias77.CliUi --version 1.1.10                
NuGet\Install-Package Matthias77.CliUi -Version 1.1.10                
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.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Matthias77.CliUi --version 1.1.10                
#r "nuget: Matthias77.CliUi, 1.1.10"                
#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.10

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

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 265 10/23/2023
1.1.18 139 10/18/2023
1.1.17 143 10/11/2023
1.1.16 161 10/6/2023
1.1.15 144 10/2/2023
1.1.14 135 9/30/2023
1.1.13 131 9/23/2023
1.1.12 124 9/23/2023
1.1.11 125 9/23/2023
1.1.10 142 9/23/2023
1.1.9 141 9/23/2023
1.1.8 138 9/23/2023
1.1.7 128 9/23/2023
1.1.6 142 9/23/2023
1.1.5 139 9/23/2023
1.1.4 125 9/19/2023
1.1.3 129 9/18/2023
1.1.2 163 9/18/2023
1.1.1 127 9/18/2023
1.1.0 135 9/18/2023
1.0.18 154 9/15/2023
1.0.17 139 9/15/2023
1.0.16 150 9/11/2023
1.0.15 142 9/11/2023
1.0.14 163 9/9/2023
1.0.13 161 9/9/2023
1.0.12 145 9/6/2023
1.0.11 135 9/3/2023
1.0.10 151 9/2/2023