Merge branch 'master' into merges/release/15.5-to-master-20171031-070033

This commit is contained in:
Livar 2017-10-31 10:15:11 -07:00 committed by GitHub
commit 2031c9cf33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
427 changed files with 3948 additions and 6665 deletions

View file

@ -77,7 +77,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;
@ -92,7 +91,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"))
{
@ -159,9 +159,8 @@ namespace Microsoft.DotNet.Cli
? 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")}");
}
@ -171,6 +170,7 @@ namespace Microsoft.DotNet.Cli
if (BuiltInCommandsCatalog.Commands.TryGetValue(topLevelCommandParserResult.Command, out var builtIn))
{
TelemetryEventEntry.SendFiltered(Parser.Instance.ParseFrom($"dotnet {topLevelCommandParserResult.Command}", appArgs.ToArray()));
exitCode = builtIn.Command(appArgs.ToArray());
}
else