Merge pull request #7303 from natemcmaster/verbose-reporter

Show verbose output when --diagnostics is specified
This commit is contained in:
Livar 2017-07-27 18:39:57 -07:00 committed by GitHub
commit 711b0fa603

View file

@ -75,7 +75,6 @@ namespace Microsoft.DotNet.Cli
{
// CommandLineApplication is a bit restrictive, so we parse things ourselves here. Individual apps should use CLA.
bool? verbose = null;
var success = true;
var command = string.Empty;
var lastArg = 0;
@ -87,7 +86,8 @@ namespace Microsoft.DotNet.Cli
{
if (IsArg(args[lastArg], "d", "diagnostics"))
{
verbose = true;
Environment.SetEnvironmentVariable(CommandContext.Variables.Verbose, bool.TrueString);
CommandContext.SetVerbose(true);
}
else if (IsArg(args[lastArg], "version"))
{
@ -134,9 +134,8 @@ namespace Microsoft.DotNet.Cli
var appArgs = (lastArg + 1) >= args.Length ? Enumerable.Empty<string>() : args.Skip(lastArg + 1).ToArray();
if (verbose.HasValue)
if (CommandContext.IsVerbose())
{
Environment.SetEnvironmentVariable(CommandContext.Variables.Verbose, verbose.ToString());
Console.WriteLine($"Telemetry is: {(telemetryClient.Enabled ? "Enabled" : "Disabled")}");
}