TJC.ConsoleApplication 0.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package TJC.ConsoleApplication --version 0.1.4
                    
NuGet\Install-Package TJC.ConsoleApplication -Version 0.1.4
                    
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="TJC.ConsoleApplication" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TJC.ConsoleApplication" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="TJC.ConsoleApplication" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TJC.ConsoleApplication --version 0.1.4
                    
#r "nuget: TJC.ConsoleApplication, 0.1.4"
                    
#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.
#:package TJC.ConsoleApplication@0.1.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TJC.ConsoleApplication&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=TJC.ConsoleApplication&version=0.1.4
                    
Install as a Cake Tool

NuGet Version and Downloads count

Prompts

Yes/No

bool ConsolePrompt.GetYesNo(string message)
  • Prompts the user with the message and waits for a 'Y' or 'N' input (case-insensitive)
  • Outputs error message and waits for input again if input is invalid
  • Returns true if 'Y' and false if 'N'
var result = ConsolePrompt.GetYesNo("Do you want to continue?");
// Outputs: Do you want to continue? (Y/N): 

Text

string ConsolePrompt.GetString(string message)
  • Prompts the user with the message and waits for a string input
var result = ConsolePrompt.GetString("Enter your name:");
// Outputs: Enter your name:
string ConsolePrompt.GetStringChange(string message, string original)
  • Prompts the user to choose whether to change from original value or not
var original = "John"
var result = ConsolePrompt.GetStringChange("MyName", original);
// Outputs: Do you want to change MyName from [John]? (Y/N):
// Waits for user input of 'Y' or 'N' (case-insensitive)
// Returns the original value if 'N' otherwise prompts for a new value like so:
// Outputs: MyName:
ConsolePrompt.GetStringChange(string message, ref string value)
  • Prompts the user to choose whether to change from original value or not
var original = "John"
ConsolePrompt.GetStringChange("MyName", ref original);
// Outputs: Do you want to change MyName from [John]? (Y/N):
// Waits for user input of 'Y' or 'N' (case-insensitive)
// Returns the original value if 'N' otherwise prompts for a new value like so
// Outputs: MyName:

Numbers

int ConsolePrompt.GetInt(string message)
  • Prompts the user to enter an integer
  • Outputs error message and waits for input again if input is invalid
ConsolePrompt.GetInt("Enter Value");
int ConsolePrompt.GetIntRange(string message, int max, int min, bool inclusive)
  • Prompts the user to enter an integer within a specified range (inclusive or exclusive)
  • Outputs error message and waits for input again if input is invalid
ConsolePrompt.GetInt("Enter Value", 10, 1);

Collections

ICollection<string> ConsolePrompt.GetCollection(string message, string messageIndividual = "")
  • Prompts the user to enter a collection of strings
  • If messageIndividual is provided, it will be used as the prompt for each item in the collection
  • If no value is provided, the collection ends, and the response(s) are returned
var collection = ConsolePrompt.GetCollection("Enter a collection of strings", "str");
// Outputs: Enter a collection of strings (press enter after each item | press enter on an empty line to complete the list):
// Outputs: str:
ICollection<int> ConsolePrompt.GetCollectionInt(string message, string messageIndividual = "")
  • Prompts the user to enter a collection of integers
var collection = ConsolePrompt.GetCollection("Enter a collection of ints");
ICollection<double> ConsolePrompt.GetCollectionDouble(string message, string messageIndividual = "")
  • Prompts the user to enter a collection of doubles
var collection = ConsolePrompt.GetCollection("Enter a collection of doubles");
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TJC.ConsoleApplication:

Package Downloads
TJC.Collection.Console

Collection of NuGet Packages for Console Applications

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.14.7 258 4/15/2025
0.14.6 287 1/3/2025
0.14.5 133 1/3/2025
0.14.4 207 12/3/2024
0.14.3 482 11/15/2024
0.14.2 202 11/10/2024
0.14.1 123 11/5/2024
0.14.0 188 11/5/2024
0.13.1 360 10/27/2024
0.13.0 143 10/26/2024
0.12.1 111 10/26/2024
0.12.0 148 10/26/2024
0.11.0 100 10/26/2024
0.10.0 99 10/25/2024
0.8.0 144 10/20/2024
0.7.5 211 10/20/2024
0.7.4 110 10/20/2024
0.7.3 110 10/20/2024
0.7.2 173 10/16/2024
0.7.1 140 10/13/2024
0.7.0 147 10/11/2024
0.6.0 107 10/11/2024
0.5.0 106 10/11/2024
0.4.0 165 10/10/2024
0.3.0 166 10/9/2024
0.2.0 112 10/8/2024
0.1.27 169 10/6/2024
0.1.26 178 10/2/2024
0.1.25 167 9/29/2024
0.1.24 203 9/26/2024
0.1.23 203 9/9/2024
0.1.22 124 9/9/2024
0.1.21 153 9/6/2024
0.1.20 215 9/5/2024
0.1.19 124 9/5/2024
0.1.18 255 9/5/2024
0.1.17 118 9/5/2024
0.1.16 124 9/5/2024
0.1.15 171 9/4/2024
0.1.14 128 9/4/2024
0.1.13 114 9/3/2024
0.1.12 274 8/22/2024
0.1.11 152 8/22/2024
0.1.10 187 7/25/2024
0.1.9 117 7/24/2024
0.1.8 138 7/22/2024
0.1.7 129 7/22/2024
0.1.6 134 7/21/2024
0.1.5 128 7/21/2024
0.1.4 137 7/21/2024
0.1.3 125 7/21/2024
0.1.2 141 7/21/2024
0.1.1 132 7/21/2024
0.1.0 133 7/21/2024