Skip to content

fjunqueira/hinter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hinter

A (very) simple lib to add hinting capabilities to C# console applications

I had to add this feature to a project I was working on, and thought it might be useful to someone else.

You can find it on nuget

Example program:

using System;
using System.Collections.Generic;
using HinterLib;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;

            var countries = new List<string>()
            {
                "Brazil",
                "Argentina",
                "Uruguay",
                "Chile",
                "Peru"
            };

            Console.WriteLine("Available countries:");
            Console.WriteLine();

            foreach (var country in countries)
                Console.WriteLine(country);

            Console.WriteLine();
            Console.WriteLine("Enter a country:");

            var input = Hinter.ReadHintedLine(countries, country => country);

            Console.WriteLine();
            Console.WriteLine($"You entered: {input}");
            Console.ReadLine();
        }
    }
}

alt tag

About

A (very) simple lib to add hinting capabilities to C# console applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages