From 3f1ab372b49731b258a96d81119ada309d7cfa4f Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Tue, 17 Apr 2018 17:04:12 -0700 Subject: [PATCH] Rename buildserver command. This commit renames the `buildserver` command to `build-server`. Fixes #9075. --- src/dotnet/BuiltInCommandsCatalog.cs | 2 +- .../dotnet-buildserver/BuildServerCommand.cs | 2 +- .../BuildServerCommandParser.cs | 2 +- .../commands/dotnet-help/HelpUsageText.cs | 2 +- ...ivenThatIWantToShowHelpForDotnetCommand.cs | 2 +- .../BuildServerShutdownCommandTests.cs | 4 ++-- .../BuildServerShutdownParserTests.cs | 20 +++++++++---------- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/dotnet/BuiltInCommandsCatalog.cs b/src/dotnet/BuiltInCommandsCatalog.cs index 8a6f81824..e8faed4d9 100644 --- a/src/dotnet/BuiltInCommandsCatalog.cs +++ b/src/dotnet/BuiltInCommandsCatalog.cs @@ -151,7 +151,7 @@ namespace Microsoft.DotNet.Cli Command = ToolCommand.Run, DocLink = "https://aka.ms/dotnet-tool" }, - ["buildserver"] = new BuiltInCommandMetadata + ["build-server"] = new BuiltInCommandMetadata { Command = BuildServerCommand.Run, DocLink = "https://aka.ms/dotnet-build-server" diff --git a/src/dotnet/commands/dotnet-buildserver/BuildServerCommand.cs b/src/dotnet/commands/dotnet-buildserver/BuildServerCommand.cs index e45302274..801a3edff 100644 --- a/src/dotnet/commands/dotnet-buildserver/BuildServerCommand.cs +++ b/src/dotnet/commands/dotnet-buildserver/BuildServerCommand.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Tools.BuildServer { public class BuildServerCommand : DotNetTopLevelCommandBase { - protected override string CommandName => "buildserver"; + protected override string CommandName => "build-server"; protected override string FullCommandNameLocalized => LocalizableStrings.BuildServerCommandName; protected override string ArgumentName => ""; protected override string ArgumentDescriptionLocalized => ""; diff --git a/src/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs b/src/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs index a7693c2d7..b298d391d 100644 --- a/src/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs +++ b/src/dotnet/commands/dotnet-buildserver/BuildServerCommandParser.cs @@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Cli public static Command CreateCommand() { return Create.Command( - "buildserver", + "build-server", LocalizableStrings.CommandDescription, Accept.NoArguments(), CommonOptions.HelpOption(), diff --git a/src/dotnet/commands/dotnet-help/HelpUsageText.cs b/src/dotnet/commands/dotnet-help/HelpUsageText.cs index afb84106f..0579e9d80 100644 --- a/src/dotnet/commands/dotnet-help/HelpUsageText.cs +++ b/src/dotnet/commands/dotnet-help/HelpUsageText.cs @@ -29,7 +29,7 @@ path-to-application: vstest {LocalizableStrings.VsTestDefinition} store {LocalizableStrings.StoreDefinition} tool {LocalizableStrings.ToolDefinition} - buildserver {LocalizableStrings.BuildServerDefinition} + build-server {LocalizableStrings.BuildServerDefinition} help {LocalizableStrings.HelpDefinition} {LocalizableStrings.CommonOptions}: diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs index 38089f254..09461ed59 100644 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs @@ -40,7 +40,7 @@ SDK commands: vstest Runs Microsoft Test Execution Command Line Tool. store Stores the specified assemblies in the runtime store. tool Install or work with tools that extend the .NET experience. - buildserver Interact with servers started by a build. + build-server Interact with servers started by a build. help Show help. Common options: diff --git a/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs b/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs index 795fe57d9..f41bc9400 100644 --- a/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/BuildServerShutdownCommandTests.cs @@ -172,9 +172,9 @@ namespace Microsoft.DotNet.Tests.Commands private BuildServerShutdownCommand CreateCommand(string options = "", IEnumerable managers = null) { - ParseResult result = Parser.Instance.Parse("dotnet buildserver shutdown " + options); + ParseResult result = Parser.Instance.Parse("dotnet build-server shutdown " + options); return new BuildServerShutdownCommand( - options: result["dotnet"]["buildserver"]["shutdown"], + options: result["dotnet"]["build-server"]["shutdown"], result: result, managers: managers, useOrderedWait: true, diff --git a/test/dotnet.Tests/ParserTests/BuildServerShutdownParserTests.cs b/test/dotnet.Tests/ParserTests/BuildServerShutdownParserTests.cs index fb6e66bc1..d17f6002e 100644 --- a/test/dotnet.Tests/ParserTests/BuildServerShutdownParserTests.cs +++ b/test/dotnet.Tests/ParserTests/BuildServerShutdownParserTests.cs @@ -23,9 +23,9 @@ namespace Microsoft.DotNet.Tests.ParserTests [Fact] public void GivenNoOptionsAllFlagsAreFalse() { - var result = Parser.Instance.Parse("dotnet buildserver shutdown"); + var result = Parser.Instance.Parse("dotnet build-server shutdown"); - var options = result["dotnet"]["buildserver"]["shutdown"]; + var options = result["dotnet"]["build-server"]["shutdown"]; options.ValueOrDefault("msbuild").Should().Be(false); options.ValueOrDefault("vbcscompiler").Should().Be(false); options.ValueOrDefault("razor").Should().Be(false); @@ -34,9 +34,9 @@ namespace Microsoft.DotNet.Tests.ParserTests [Fact] public void GivenMSBuildOptionIsItTrue() { - var result = Parser.Instance.Parse("dotnet buildserver shutdown --msbuild"); + var result = Parser.Instance.Parse("dotnet build-server shutdown --msbuild"); - var options = result["dotnet"]["buildserver"]["shutdown"]; + var options = result["dotnet"]["build-server"]["shutdown"]; options.ValueOrDefault("msbuild").Should().Be(true); options.ValueOrDefault("vbcscompiler").Should().Be(false); options.ValueOrDefault("razor").Should().Be(false); @@ -45,9 +45,9 @@ namespace Microsoft.DotNet.Tests.ParserTests [Fact] public void GivenVBCSCompilerOptionIsItTrue() { - var result = Parser.Instance.Parse("dotnet buildserver shutdown --vbcscompiler"); + var result = Parser.Instance.Parse("dotnet build-server shutdown --vbcscompiler"); - var options = result["dotnet"]["buildserver"]["shutdown"]; + var options = result["dotnet"]["build-server"]["shutdown"]; options.ValueOrDefault("msbuild").Should().Be(false); options.ValueOrDefault("vbcscompiler").Should().Be(true); options.ValueOrDefault("razor").Should().Be(false); @@ -56,9 +56,9 @@ namespace Microsoft.DotNet.Tests.ParserTests [Fact] public void GivenRazorOptionIsItTrue() { - var result = Parser.Instance.Parse("dotnet buildserver shutdown --razor"); + var result = Parser.Instance.Parse("dotnet build-server shutdown --razor"); - var options = result["dotnet"]["buildserver"]["shutdown"]; + var options = result["dotnet"]["build-server"]["shutdown"]; options.ValueOrDefault("msbuild").Should().Be(false); options.ValueOrDefault("vbcscompiler").Should().Be(false); options.ValueOrDefault("razor").Should().Be(true); @@ -67,9 +67,9 @@ namespace Microsoft.DotNet.Tests.ParserTests [Fact] public void GivenMultipleOptionsThoseAreTrue() { - var result = Parser.Instance.Parse("dotnet buildserver shutdown --razor --msbuild"); + var result = Parser.Instance.Parse("dotnet build-server shutdown --razor --msbuild"); - var options = result["dotnet"]["buildserver"]["shutdown"]; + var options = result["dotnet"]["build-server"]["shutdown"]; options.ValueOrDefault("msbuild").Should().Be(true); options.ValueOrDefault("vbcscompiler").Should().Be(false); options.ValueOrDefault("razor").Should().Be(true);