diff --git a/src/dotnet/commands/dotnet-restore/NuGet3.cs b/src/dotnet/commands/dotnet-restore/NuGet3.cs index c7d866ca5..8033f96f6 100644 --- a/src/dotnet/commands/dotnet-restore/NuGet3.cs +++ b/src/dotnet/commands/dotnet-restore/NuGet3.cs @@ -10,13 +10,13 @@ namespace Microsoft.DotNet.Tools.Restore { internal static class NuGet3 { - public static int Restore(IEnumerable args, bool quiet) + public static int Restore(IEnumerable args) { var prefixArgs = new List(); - if (quiet) + if (!args.Any(s => s.Equals("--verbosity", StringComparison.OrdinalIgnoreCase) || s.Equals("-v", StringComparison.OrdinalIgnoreCase))) { prefixArgs.Add("--verbosity"); - prefixArgs.Add("Error"); + prefixArgs.Add("minimal"); } prefixArgs.Add("restore"); diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index 6616f75dc..7d45322c1 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -24,16 +24,12 @@ namespace Microsoft.DotNet.Tools.Restore Description = "Restores dependencies listed in project.json" }; - // Parse --quiet, because we have to handle that specially since NuGet3 has a different - // "--verbosity" switch that goes BEFORE the command - var quiet = args.Any(s => s.Equals("--quiet", StringComparison.OrdinalIgnoreCase)); - args = args.Where(s => !s.Equals("--quiet", StringComparison.OrdinalIgnoreCase)).ToArray(); app.OnExecute(() => { try { - return NuGet3.Restore(args, quiet); + return NuGet3.Restore(args); } catch (InvalidOperationException e) { diff --git a/test/EndToEnd/EndToEndTest.cs b/test/EndToEnd/EndToEndTest.cs index eeb4e6ace..ec5ba4baf 100644 --- a/test/EndToEnd/EndToEndTest.cs +++ b/test/EndToEnd/EndToEndTest.cs @@ -218,7 +218,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd Directory.SetCurrentDirectory(RestoredTestProjectDirectory); new NewCommand().Execute().Should().Pass(); - new RestoreCommand().Execute("--quiet").Should().Pass(); + new RestoreCommand().Execute().Should().Pass(); Directory.SetCurrentDirectory(currentDirectory); } diff --git a/test/Performance/HelloWorld.cs b/test/Performance/HelloWorld.cs index d2421a688..828613a32 100644 --- a/test/Performance/HelloWorld.cs +++ b/test/Performance/HelloWorld.cs @@ -81,7 +81,7 @@ namespace Microsoft.DotNet.Tests.Performance var restoreCommand = new RestoreCommand(); restoreCommand.WorkingDirectory = RestoredTestProjectDirectory; - restoreCommand.Execute("--quiet").Should().Pass(); + restoreCommand.Execute().Should().Pass(); } } }