Matthias77.CliUi
1.1.9
See the version list below for details.
dotnet add package Matthias77.CliUi --version 1.1.9
NuGet\Install-Package Matthias77.CliUi -Version 1.1.9
<PackageReference Include="Matthias77.CliUi" Version="1.1.9" />
paket add Matthias77.CliUi --version 1.1.9
#r "nuget: Matthias77.CliUi, 1.1.9"
// Install Matthias77.CliUi as a Cake Addin #addin nuget:?package=Matthias77.CliUi&version=1.1.9 // Install Matthias77.CliUi as a Cake Tool #tool nuget:?package=Matthias77.CliUi&version=1.1.9
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 | 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
- 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 | 254 | 10/23/2023 |
1.1.18 | 125 | 10/18/2023 |
1.1.17 | 130 | 10/11/2023 |
1.1.16 | 140 | 10/6/2023 |
1.1.15 | 128 | 10/2/2023 |
1.1.14 | 119 | 9/30/2023 |
1.1.13 | 118 | 9/23/2023 |
1.1.12 | 110 | 9/23/2023 |
1.1.11 | 108 | 9/23/2023 |
1.1.10 | 120 | 9/23/2023 |
1.1.9 | 126 | 9/23/2023 |
1.1.8 | 123 | 9/23/2023 |
1.1.7 | 112 | 9/23/2023 |
1.1.6 | 128 | 9/23/2023 |
1.1.5 | 127 | 9/23/2023 |
1.1.4 | 112 | 9/19/2023 |
1.1.3 | 116 | 9/18/2023 |
1.1.2 | 114 | 9/18/2023 |
1.1.1 | 114 | 9/18/2023 |
1.1.0 | 118 | 9/18/2023 |
1.0.18 | 138 | 9/15/2023 |
1.0.17 | 128 | 9/15/2023 |
1.0.16 | 134 | 9/11/2023 |
1.0.15 | 124 | 9/11/2023 |
1.0.14 | 150 | 9/9/2023 |
1.0.13 | 134 | 9/9/2023 |
1.0.12 | 125 | 9/6/2023 |
1.0.11 | 123 | 9/3/2023 |
1.0.10 | 138 | 9/2/2023 |