Esempio n. 1
0
            public Task <int> InvokeAsync(InvocationContext context)
            {
                var table = new TableView <KeyValuePair <string, ServiceEntry> > {
                    Items = _options.Value.ToList()
                };

                table.AddColumn(
                    entry => entry.Key,
                    Underline("Name"),
                    ColumnDefinition.SizeToContent());

                table.AddColumn(
                    entry => entry.Value.Sources.Count(),
                    Underline("Configured Sources"),
                    ColumnDefinition.Star(1));

                // table.AddColumn(
                //     entry => entry.SourceType,
                //     Underline(nameof(ServiceEntry.SourceType)),
                //     ColumnDefinition.SizeToContent());
                //
                // table.AddColumn(
                //     entry => entry.Type,
                //     Underline(nameof(ServiceEntry.Type)),
                //     ColumnDefinition.SizeToContent());
                //
                // table.AddColumn(
                //     entry => entry.GitCloneUrl,
                //     Underline(nameof(ServiceEntry.GitCloneUrl)),
                //     ColumnDefinition.Star(1));

                _console.Append(table, _console.DetectOutputMode());

                return(Task.FromResult(context.ResultCode));
            }
Esempio n. 2
0
            public Task <int> InvokeAsync(InvocationContext ic)
            {
                var view = new AffectedInfoView(_context);

                _console.Append(view);

                return(Task.FromResult(0));
            }
Esempio n. 3
0
            public async Task <int> InvokeAsync(InvocationContext ic)
            {
                if (_data.Verbose)
                {
                    var infoView = new AffectedInfoView(_context);

                    _console.Append(infoView);
                }

                // TODO: OutputName & OutputDir
                await _formatterExecutor.Execute(_context.ChangedProjects.Concat(_context.AffectedProjects),
                                                 _data.Formatters, _data.OutputDir, _data.OutputName, _data.DryRun, _data.Verbose);

                return(0);
            }