public static CommandLineBuilder UseAnsiTerminalWhenAvailable( this CommandLineBuilder builder) { builder.ConfigureConsole(context => { return(GetTerminal(context.Console, true)); }); return(builder); }
public static CommandLineBuilder UseAnsiTerminalWhenAvailable( this CommandLineBuilder builder) { builder.ConfigureConsole(context => { var console = context.Console; var terminal = console.GetTerminal( PreferVirtualTerminal(context), OutputMode(context)); return(terminal ?? console); }); return(builder); }
public override CommandLineBuilder CreateCommandLineBuilder(string[] args) { CommandLineBuilder cliBuilder = base.CreateCommandLineBuilder(args); ConfigureServices += services => { services.AddSingleton <IConsole>(Console); }; ConfigureAppConfiguration += builder => { if (Configuration != null && Configuration.Any()) { builder.AddInMemoryCollection(Configuration); } }; return(cliBuilder.ConfigureConsole(context => Console)); }