Skip to content

A library for creating console-based wizards and application prototypes.

Notifications You must be signed in to change notification settings

jmussett/ConsoleWizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Console Wizard

latest version

Console Wizard is a library for creating console-based wizards and application prototypes.

It provides the following types of console utility functions:

  • Retrying actions in response to invalid user input.
  • Automatic input validation for numeric data types.
  • Searching flat and tree-based data structures.
  • Searching for files and directories in a file system.
  • Inspecting the properties and values of object instances.

Basic Usage

For basic input validation, you can use switch statements to validate a list of opions:

ConsoleWizard.WaitForDigitAsync(
    () =>
    {
        Console.WriteLine("Please select an option:");
        Console.WriteLine("1. Option 1");
        Console.WriteLine("2. Option 2");
        Console.WriteLine("3. Option 3");
    },
    result =>
    {
        switch (result)
        {
            case 1:
                // Do stuff
                return true;
            case 2:
                // Do stuff
                return true;
            case 3:
                // Do stuff
                return true;
            default:
                Console.WriteLine("Input invalid.");
                return false;
        }
    }
);

About

A library for creating console-based wizards and application prototypes.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages