Last active
January 13, 2019 03:14
-
-
Save CristianoRC/29ac3d43507a448db3172034a8aa2dfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CommandLine; | |
namespace parametros | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Parser.Default.ParseArguments<Options>(args) | |
.WithParsed(options => | |
{ | |
Console.Title = options.Title; | |
if (options.Verbose) | |
{ | |
if (!string.IsNullOrEmpty(options.Color)) | |
{ | |
Enum.TryParse(options.Color, true, out ConsoleColor consoleColor); | |
Console.ForegroundColor = consoleColor; | |
} | |
Console.Clear(); | |
Console.WriteLine($"Título informado: {options.Title}\n"); | |
Console.WriteLine($"Nome completo: {options.Name}"); | |
Console.ReadKey(); | |
} | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment