Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit d51926a

Browse files
author
William Li
committed
Rename to add source
1 parent 04066cb commit d51926a

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

src/dotnet/commands/dotnet-tool/install/ToolInstallCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ToolInstallCommand(
5555
_packageVersion = appliedCommand.ValueOrDefault<string>("version");
5656
_configFilePath = appliedCommand.ValueOrDefault<string>("configfile");
5757
_framework = appliedCommand.ValueOrDefault<string>("framework");
58-
_source = appliedCommand.ValueOrDefault<string[]>("source-feed");
58+
_source = appliedCommand.ValueOrDefault<string[]>("add-source");
5959
_global = appliedCommand.ValueOrDefault<bool>("global");
6060
_verbosity = appliedCommand.SingleArgumentOrDefault("verbosity");
6161
_toolPath = appliedCommand.SingleArgumentOrDefault("tool-path");

src/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static Command ToolInstall()
3232
LocalizableStrings.ConfigFileOptionDescription,
3333
Accept.ExactlyOneArgument()),
3434
Create.Option(
35-
"--source-feed",
35+
"--add-source",
3636
LocalizableStrings.SourceFeedOptionDescription,
3737
Accept.OneOrMoreArguments()
3838
.With(name: LocalizableStrings.SourceFeedOptionName)),

src/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public ToolUpdateCommand(AppliedOption appliedCommand,
5252
_packageId = new PackageId(appliedCommand.Arguments.Single());
5353
_configFilePath = appliedCommand.ValueOrDefault<string>("configfile");
5454
_framework = appliedCommand.ValueOrDefault<string>("framework");
55-
_additionalFeeds = appliedCommand.ValueOrDefault<string[]>("source-feed");
55+
_additionalFeeds = appliedCommand.ValueOrDefault<string[]>("add-source");
5656
_global = appliedCommand.ValueOrDefault<bool>("global");
5757
_verbosity = appliedCommand.SingleArgumentOrDefault("verbosity");
5858
_toolPath = appliedCommand.SingleArgumentOrDefault("tool-path");

src/dotnet/commands/dotnet-tool/update/ToolUpdateCommandParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static Command ToolUpdate()
2828
LocalizableStrings.ConfigFileOptionDescription,
2929
Accept.ExactlyOneArgument()),
3030
Create.Option(
31-
"--source-feed",
31+
"--add-source",
3232
LocalizableStrings.SourceFeedOptionDescription,
3333
Accept.OneOrMoreArguments()
3434
.With(name: LocalizableStrings.SourceFeedOptionName)),

test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ public void WhenRunWithPackageIdItShouldCreateValidShim()
8585
public void WhenRunWithPackageIdWithSourceItShouldCreateValidShim()
8686
{
8787
const string sourcePath = "http://mysouce.com";
88-
ParseResult result = Parser.Instance.Parse($"dotnet tool install -g {PackageId} --source-feed {sourcePath}");
88+
ParseResult result = Parser.Instance.Parse($"dotnet tool install -g {PackageId} --add-source {sourcePath}");
8989
AppliedOption appliedCommand = result["dotnet"]["tool"]["install"];
9090
ParseResult parseResult =
91-
Parser.Instance.ParseFrom("dotnet tool", new[] { "install", "-g", PackageId, "--source-feed", sourcePath });
91+
Parser.Instance.ParseFrom("dotnet tool", new[] { "install", "-g", PackageId, "--add-source", sourcePath });
9292

9393

9494
var toolToolPackageInstaller = CreateToolPackageInstaller(

test/dotnet.Tests/ParserTests/InstallToolParserTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public void InstallToolParserCanParseSourceOption()
5555
const string expectedSourceValue = "TestSourceValue";
5656

5757
var result =
58-
Parser.Instance.Parse($"dotnet tool install -g --source-feed {expectedSourceValue} console.test.app");
58+
Parser.Instance.Parse($"dotnet tool install -g --add-source {expectedSourceValue} console.test.app");
5959

6060
var appliedOptions = result["dotnet"]["tool"]["install"];
61-
appliedOptions.ValueOrDefault<string[]>("source-feed").First().Should().Be(expectedSourceValue);
61+
appliedOptions.ValueOrDefault<string[]>("add-source").First().Should().Be(expectedSourceValue);
6262
}
6363

6464
[Fact]
@@ -70,13 +70,13 @@ public void InstallToolParserCanParseMultipleSourceOption()
7070
var result =
7171
Parser.Instance.Parse(
7272
$"dotnet tool install -g " +
73-
$"--source-feed {expectedSourceValue1} " +
74-
$"--source-feed {expectedSourceValue2} console.test.app");
73+
$"--add-source {expectedSourceValue1} " +
74+
$"--add-source {expectedSourceValue2} console.test.app");
7575

7676
var appliedOptions = result["dotnet"]["tool"]["install"];
7777

78-
appliedOptions.ValueOrDefault<string[]>("source-feed")[0].Should().Be(expectedSourceValue1);
79-
appliedOptions.ValueOrDefault<string[]>("source-feed")[1].Should().Be(expectedSourceValue2);
78+
appliedOptions.ValueOrDefault<string[]>("add-source")[0].Should().Be(expectedSourceValue1);
79+
appliedOptions.ValueOrDefault<string[]>("add-source")[1].Should().Be(expectedSourceValue2);
8080
}
8181

8282
[Fact]

test/dotnet.Tests/ParserTests/UpdateToolParserTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public void UpdateToolParserCanParseSourceOption()
6262
const string expectedSourceValue = "TestSourceValue";
6363

6464
var result =
65-
Parser.Instance.Parse($"dotnet tool update -g --source-feed {expectedSourceValue} console.test.app");
65+
Parser.Instance.Parse($"dotnet tool update -g --add-source {expectedSourceValue} console.test.app");
6666

6767
var appliedOptions = result["dotnet"]["tool"]["update"];
68-
appliedOptions.ValueOrDefault<string[]>("source-feed").First().Should().Be(expectedSourceValue);
68+
appliedOptions.ValueOrDefault<string[]>("add-source").First().Should().Be(expectedSourceValue);
6969
}
7070

7171
[Fact]
@@ -77,13 +77,13 @@ public void UpdateToolParserCanParseMultipleSourceOption()
7777
var result =
7878
Parser.Instance.Parse(
7979
$"dotnet tool update -g " +
80-
$"--source-feed {expectedSourceValue1} " +
81-
$"--source-feed {expectedSourceValue2} console.test.app");
80+
$"--add-source {expectedSourceValue1} " +
81+
$"--add-source {expectedSourceValue2} console.test.app");
8282

8383
var appliedOptions = result["dotnet"]["tool"]["update"];
8484

85-
appliedOptions.ValueOrDefault<string[]>("source-feed")[0].Should().Be(expectedSourceValue1);
86-
appliedOptions.ValueOrDefault<string[]>("source-feed")[1].Should().Be(expectedSourceValue2);
85+
appliedOptions.ValueOrDefault<string[]>("add-source")[0].Should().Be(expectedSourceValue1);
86+
appliedOptions.ValueOrDefault<string[]>("add-source")[1].Should().Be(expectedSourceValue2);
8787
}
8888

8989
[Fact]

0 commit comments

Comments
 (0)