Exemplo n.º 1
0
            protected override async Task <int> OnExecuteAuthenticatedAsync(QBittorrentClient client, CommandLineApplication app, IConsole console)
            {
                var(apiVersion, legacyApiVersion, legacyApiMinVersion, qVersion, build) = await TaskHelper.WhenAll(
                    client.GetApiVersionAsync(),
                    client.GetLegacyApiVersionAsync(),
                    client.GetLegacyMinApiVersionAsync(),
                    client.GetQBittorrentVersionAsync(),
                    client.GetBuildInfoAsync());

                var doc = new Document(
                    new Grid
                {
                    Stroke   = UIHelper.NoneStroke,
                    Columns  = { UIHelper.FieldsColumns },
                    Children =
                    {
                        UIHelper.Row("QBittorrent version",    qVersion),
                        UIHelper.Row("API version",            apiVersion),
                        UIHelper.Row("Legacy API version",     legacyApiVersion),
                        UIHelper.Row("Legacy API min version", legacyApiMinVersion),
                        UIHelper.Row("Bitness",                build.Bitness),
                        UIHelper.Row("Libtorrent version",     build.LibtorrentVersion),
                        UIHelper.Row("Qt version",             build.QtVersion),
                        UIHelper.Row("Boost version",          build.BoostVersion),
                        UIHelper.Row("OpenSSL version",        build.OpenSslVersion),
                        UIHelper.Row("ZLib version",           build.ZlibVersion),
                    }
                }
                    ).SetColors(ColorScheme.Current.Normal);

                ConsoleRenderer.RenderDocument(doc);

                return(ExitCodes.Success);
            }