コード例 #1
0
        public static CommandLineBuilder UseAnsiTerminalWhenAvailable(
            this CommandLineBuilder builder)
        {
            builder.ConfigureConsole(context =>
            {
                return(GetTerminal(context.Console, true));
            });

            return(builder);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: CliTestBase.cs プロジェクト: osoykan/Samples
        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));
        }