diff --git a/scripts/install.sh b/scripts/install.sh index 74e891d..47bd1c2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -76,5 +76,4 @@ rm -rf "$UCPATH" configcat cat -echo echo "==> ConfigCat CLI v${VERSION} successfully installed. Happy Feature Flagging!" diff --git a/src/ConfigCat.Cli/Commands/Scan.cs b/src/ConfigCat.Cli/Commands/Scan.cs index d546c1e..05c61ec 100644 --- a/src/ConfigCat.Cli/Commands/Scan.cs +++ b/src/ConfigCat.Cli/Commands/Scan.cs @@ -67,13 +67,13 @@ public async Task InvokeAsync(ScanArguments scanArguments, CancellationToke var aliveFlagReferences = Filter(flagReferences, r => r.FoundFlag is not DeletedFlagModel); var deletedFlagReferences = Filter(flagReferences, r => r.FoundFlag is DeletedFlagModel); - this.output.Write("Found "); - this.output.WriteColored(aliveFlagReferences.Sum(f => f.References.Count()).ToString(), ForegroundColorSpan.LightCyan()); - this.output.Write($" feature flag / setting reference(s) in "); - this.output.WriteColored(aliveFlagReferences.Count().ToString(), ForegroundColorSpan.LightCyan()); - this.output.Write(" file(s). " + - $"Keys: [{string.Join(", ", aliveFlagReferences.SelectMany(r => r.References).Select(r => r.FoundFlag.Key).Distinct())}]"); - this.output.WriteLine(); + this.output.Write("Found ") + .WriteColored(aliveFlagReferences.Sum(f => f.References.Count()).ToString(), ForegroundColorSpan.LightCyan()) + .Write($" feature flag / setting reference(s) in ") + .WriteColored(aliveFlagReferences.Count().ToString(), ForegroundColorSpan.LightCyan()) + .Write(" file(s). " + + $"Keys: [{string.Join(", ", aliveFlagReferences.SelectMany(r => r.References).Select(r => r.FoundFlag.Key).Distinct())}]") + .WriteLine(); if (scanArguments.Print) this.PrintReferences(aliveFlagReferences); @@ -104,9 +104,9 @@ public async Task InvokeAsync(ScanArguments scanArguments, CancellationToke var branch = gitInfo == null || gitInfo.Branch.IsEmpty() ? scanArguments.Branch : gitInfo.Branch; var commitHash = gitInfo?.CurrentCommitHash ?? scanArguments.CommitHash; - this.output.WriteUnderline("Repository").Write(":").WriteColored($" {scanArguments.Repo}", ForegroundColorSpan.LightCyan()).WriteLine(); - this.output.WriteUnderline("Branch").Write(":").WriteColored($" {branch}", ForegroundColorSpan.LightCyan()).WriteLine(); - this.output.WriteUnderline("Commit").Write(":").WriteColored($" {commitHash}", ForegroundColorSpan.LightCyan()).WriteLine(); + this.output.WriteUnderline("Repository").Write(":").WriteColored($" {scanArguments.Repo}", ForegroundColorSpan.LightCyan()).WriteLine() + .WriteUnderline("Branch").Write(":").WriteColored($" {branch}", ForegroundColorSpan.LightCyan()).WriteLine() + .WriteUnderline("Commit").Write(":").WriteColored($" {commitHash}", ForegroundColorSpan.LightCyan()).WriteLine(); var repositoryDirectory = gitInfo == null || gitInfo.WorkingDirectory.IsEmpty() ? scanArguments.Directory.FullName : gitInfo.WorkingDirectory; await this.codeReferenceClient.UploadAsync(new CodeReferenceRequest { diff --git a/src/ConfigCat.Cli/Commands/Setup.cs b/src/ConfigCat.Cli/Commands/Setup.cs index 17b5d45..19362f4 100644 --- a/src/ConfigCat.Cli/Commands/Setup.cs +++ b/src/ConfigCat.Cli/Commands/Setup.cs @@ -51,19 +51,15 @@ public async Task InvokeAsync(SetupArgs arguments, CancellationToken token) }; await this.configurationStorage.WriteConfigAsync(this.cliConfig, token); - this.output.WriteSuccess(); - this.output.WriteLine(); - this.output.Write($"Verifying your credentials against '{arguments.ApiHost}'... "); + this.output.WriteSuccess().WriteLine().Write($"Verifying your credentials against '{arguments.ApiHost}'... "); var me = await this.meClient.GetMeAsync(token); - this.output.WriteSuccess(); - this.output.Write($" Welcome, {me.FullName}."); - this.output.WriteLine(); - this.output.WriteLine(); - this.output.WriteGreen("Setup complete."); - this.output.WriteLine(); - this.output.WriteLine(); + this.output.WriteSuccess() + .Write($" Welcome, {me.FullName}.") + .WriteLine().WriteLine() + .WriteGreen("Setup complete.") + .WriteLine().WriteLine(); return ExitCodes.Ok; }