InputHandler 2.0.0

dotnet add package InputHandler --version 2.0.0                
NuGet\Install-Package InputHandler -Version 2.0.0                
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="InputHandler" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InputHandler --version 2.0.0                
#r "nuget: InputHandler, 2.0.0"                
#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 InputHandler as a Cake Addin
#addin nuget:?package=InputHandler&version=2.0.0

// Install InputHandler as a Cake Tool
#tool nuget:?package=InputHandler&version=2.0.0                

InputHandler

A small library for handling user input in console apps

All methods are contained in a static class Input within the InputHandler namespace, and include XML documentation.

The UnitTests project contains unit tests for every method. <br><br><br><br><br> How to decide which method to use:

Want the user to pick from a set of options?

Want the user to input yes/no? ⇒ GetYN (includes overload to specify your own options for yes/no)

Want the user to input specifically y/n? ⇒ GetYNStrict

Want the user to choose from a collection of options? ⇒ GetOption (includes generic overload if you want to convert it off of string after, and one if you want them to choose from string keys in a Dictionary, and another if you want to choose from names in an Enum)

Want the user to enter one input...

that doesn't error? ⇒ Get

that passes a check? ⇒ GetCheck

that passes a check without throwing an exception? ⇒ GetCheck<T>

and convert it into a bool? ⇒ GetBool

Want the user to enter a block of text ending in...

the first line of whitespace? ⇒ GetUntilWhiteSpace

the first null or empty line? ⇒ GetUntilEmpty

the first line that passes a specified check? ⇒ GetUntil

Want the user to enter a series of inputs ending in...

a line of whitespace? ListUntilWhiteSpace, YieldUntilWhiteSpace

a null or empty line? ListUntilEmpty, YieldUntilEmpty

a line that passes a specified check? ListUntil, YieldUntil

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.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
2.0.0 368 1/5/2022
1.2.1 298 12/17/2021
1.2.0 2,009 11/26/2021
1.1.0 323 10/21/2021
1.0.3 313 10/20/2021
1.0.2 339 10/20/2021
1.0.0 346 10/20/2021

v2.0.0.0: overhauled everything