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

Commit 7db48a4

Browse files
author
William Li
committed
Rename to add-source
1 parent 04066cb commit 7db48a4

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

src/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@
129129
<data name="VersionOptionDescription" xml:space="preserve">
130130
<value>Version of the tool package in NuGet.</value>
131131
</data>
132-
<data name="SourceFeedOptionDescription" xml:space="preserve">
132+
<data name="AddSourceOptionDescription" xml:space="preserve">
133133
<value>Adds an additional NuGet package source to use during installation.</value>
134134
</data>
135-
<data name="SourceFeedOptionName" xml:space="preserve">
136-
<value>SOURCE_FEED</value>
135+
<data name="AddSourceOptionName" xml:space="preserve">
136+
<value>SOURCE</value>
137137
</data>
138138
<data name="CommandDescription" xml:space="preserve">
139139
<value>Installs a tool for use on the command line.</value>
@@ -195,4 +195,4 @@ Tool '{1}' (version '{2}') was successfully installed.</value>
195195
<data name="ToolPathDescription" xml:space="preserve">
196196
<value>Location where the tool will be installed.</value>
197197
</data>
198-
</root>
198+
</root>

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ public static Command ToolInstall()
3232
LocalizableStrings.ConfigFileOptionDescription,
3333
Accept.ExactlyOneArgument()),
3434
Create.Option(
35-
"--source-feed",
36-
LocalizableStrings.SourceFeedOptionDescription,
35+
"--add-source",
36+
LocalizableStrings.AddSourceOptionDescription,
3737
Accept.OneOrMoreArguments()
38-
.With(name: LocalizableStrings.SourceFeedOptionName)),
38+
.With(name: LocalizableStrings.AddSourceOptionName)),
3939
Create.Option(
4040
"--framework",
4141
LocalizableStrings.FrameworkOptionDescription,

src/dotnet/commands/dotnet-tool/update/LocalizableStrings.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@
129129
<data name="VersionOptionDescription" xml:space="preserve">
130130
<value>Version of the tool package in NuGet.</value>
131131
</data>
132-
<data name="SourceFeedOptionDescription" xml:space="preserve">
132+
<data name="AddSourceOptionDescription" xml:space="preserve">
133133
<value>Adds an additional NuGet package source to use during update.</value>
134134
</data>
135-
<data name="SourceFeedOptionName" xml:space="preserve">
136-
<value>SOURCE_FEED</value>
135+
<data name="AddSourceOptionName" xml:space="preserve">
136+
<value>ADD_SOURCE</value>
137137
</data>
138138
<data name="CommandDescription" xml:space="preserve">
139139
<value>Updates a tool to the latest stable version for use.</value>

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public static Command ToolUpdate()
2828
LocalizableStrings.ConfigFileOptionDescription,
2929
Accept.ExactlyOneArgument()),
3030
Create.Option(
31-
"--source-feed",
32-
LocalizableStrings.SourceFeedOptionDescription,
31+
"--add-source",
32+
LocalizableStrings.AddSourceOptionDescription,
3333
Accept.OneOrMoreArguments()
34-
.With(name: LocalizableStrings.SourceFeedOptionName)),
34+
.With(name: LocalizableStrings.AddSourceOptionName)),
3535
Create.Option(
3636
"--framework",
3737
LocalizableStrings.FrameworkOptionDescription,

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)