Display help typing help c #

0

I need when the user type help to print a help text, but this needs to work on any part of the code and not on some parts. Same as CMD, when someone types help, all available commands appear.

    
asked by anonymous 24.04.2015 / 19:28

1 answer

1

One option may be to define a method eg

public string LerEntradaConsole()
{
    string texto = Console.ReadLine();
    if (!texto.Contains("help"))
        return texto;
    else
    {
        ExibirTextoAjuda(texto);
        return LerEntradaConsole();
    }
}

And always use this method instead of Console.ReadLine (). In the ViewTextHelp method you will have to extract what the user typed and print the on-screen help.

    
27.04.2015 / 06:08