68 references to ToolInstallCommandParser
dotnet (45)
Commands\Tool\Common\ToolAppliedOption.cs (1)
39
=
ToolInstallCommandParser
.VersionOption
Commands\Tool\Execute\ToolExecuteCommandParser.cs (8)
12
public static readonly Argument<PackageIdentityWithRange> PackageIdentityArgument =
ToolInstallCommandParser
.PackageIdentityArgument;
19
public static readonly Option<string> VersionOption =
ToolInstallCommandParser
.VersionOption;
20
public static readonly Option<bool> RollForwardOption =
ToolInstallCommandParser
.RollForwardOption;
21
public static readonly Option<bool> PrereleaseOption =
ToolInstallCommandParser
.PrereleaseOption;
22
public static readonly Option<string> ConfigOption =
ToolInstallCommandParser
.ConfigOption;
23
public static readonly Option<string[]> SourceOption =
ToolInstallCommandParser
.SourceOption;
24
public static readonly Option<string[]> AddSourceOption =
ToolInstallCommandParser
.AddSourceOption;
27
public static readonly Option<Utils.VerbosityOptions> VerbosityOption =
ToolInstallCommandParser
.VerbosityOption;
Commands\Tool\Install\ParseResultExtension.cs (3)
14
var packageVersionFromIdentityArgument = parseResult.GetValue(
ToolInstallCommandParser
.PackageIdentityArgument).VersionRange?.OriginalString;
15
var packageVersionFromVersionOption = parseResult.GetValue(
ToolInstallCommandParser
.VersionOption);
25
bool prerelease = parseResult.GetValue(
ToolInstallCommandParser
.PrereleaseOption);
Commands\Tool\Install\ToolInstallCommand.cs (3)
19
private readonly bool _global = parseResult.GetValue(
ToolInstallCommandParser
.GlobalOption);
20
private readonly string _toolPath = parseResult.GetValue(
ToolInstallCommandParser
.ToolPathOption);
21
private readonly string _framework = parseResult.GetValue(
ToolInstallCommandParser
.FrameworkOption);
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (14)
70
var packageIdArgument = parseResult.GetValue(
ToolInstallCommandParser
.PackageIdentityArgument).Id;
73
_configFilePath = parseResult.GetValue(
ToolInstallCommandParser
.ConfigOption);
74
_framework = parseResult.GetValue(
ToolInstallCommandParser
.FrameworkOption);
75
_source = parseResult.GetValue(
ToolInstallCommandParser
.SourceOption);
76
_addSource = parseResult.GetValue(
ToolInstallCommandParser
.AddSourceOption);
77
_global = parseResult.GetValue(
ToolInstallCommandParser
.GlobalOption);
78
_verbosity = GetValueOrDefault(
ToolInstallCommandParser
.VerbosityOption, VerbosityOptions.minimal, parseResult);
79
_toolPath = parseResult.GetValue(
ToolInstallCommandParser
.ToolPathOption);
80
_architectureOption = parseResult.GetValue(
ToolInstallCommandParser
.ArchitectureOption);
82
_forwardRestoreArguments = parseResult.OptionValuesToBeForwarded(
ToolInstallCommandParser
.GetCommand());
88
var configOption = parseResult.GetValue(
ToolInstallCommandParser
.ConfigOption);
89
var sourceOption = parseResult.GetValue(
ToolInstallCommandParser
.AddSourceOption);
99
_allowRollForward = parseResult.GetValue(
ToolInstallCommandParser
.RollForwardOption);
101
_allowPackageDowngrade = parseResult.GetValue(
ToolInstallCommandParser
.AllowPackageDowngradeOption);
Commands\Tool\Install\ToolInstallLocalCommand.cs (5)
49
var packageIdArgument = parseResult.GetValue(
ToolInstallCommandParser
.PackageIdentityArgument).Id;
51
_explicitManifestFile = parseResult.GetValue(
ToolInstallCommandParser
.ToolManifestOption);
53
_createManifestIfNeeded = parseResult.GetValue(
ToolInstallCommandParser
.CreateManifestIfNeededOption);
68
_allowRollForward = parseResult.GetValue(
ToolInstallCommandParser
.RollForwardOption);
69
_allowPackageDowngrade = parseResult.GetValue(
ToolInstallCommandParser
.AllowPackageDowngradeOption);
Commands\Tool\Install\ToolInstallLocalInstaller.cs (3)
34
_configFilePath = parseResult.GetValue(
ToolInstallCommandParser
.ConfigOption);
35
_sources = parseResult.GetValue(
ToolInstallCommandParser
.AddSourceOption);
36
_verbosity = parseResult.GetValue(
ToolInstallCommandParser
.VerbosityOption);
Commands\Tool\Restore\ToolRestoreCommandParser.cs (3)
15
public static readonly Option<string> ConfigOption =
ToolInstallCommandParser
.ConfigOption;
17
public static readonly Option<string[]> AddSourceOption =
ToolInstallCommandParser
.AddSourceOption;
21
public static readonly Option<Utils.VerbosityOptions> VerbosityOption =
ToolInstallCommandParser
.VerbosityOption;
Commands\Tool\ToolCommandParser.cs (1)
34
command.Subcommands.Add(
ToolInstallCommandParser
.GetCommand());
Commands\Tool\Update\ToolUpdateCommand.cs (2)
49
_global = result.GetValue(
ToolInstallCommandParser
.GlobalOption);
50
_toolPath = result.GetValue(
ToolInstallCommandParser
.ToolPathOption);
Commands\Tool\Update\ToolUpdateCommandParser.cs (2)
16
public static readonly Option<bool> AllowPackageDowngradeOption =
ToolInstallCommandParser
.AllowPackageDowngradeOption;
31
ToolInstallCommandParser
.AddCommandOptions(command);
dotnet.Tests (23)
CommandTests\Tool\Install\InstallToolParserTests.cs (12)
28
var packageIdentity = result.GetValue(
ToolInstallCommandParser
.PackageIdentityArgument);
30
var packageVersion = packageIdentity.VersionRange?.OriginalString ?? result.GetValue(
ToolInstallCommandParser
.VersionOption);
42
result.GetRequiredValue(
ToolInstallCommandParser
.ConfigOption).Should().Be(@"C:\TestAssetLocalNugetFeed");
43
result.GetRequiredValue(
ToolInstallCommandParser
.FrameworkOption).Should().Be(ToolsetInfo.CurrentTargetFramework);
54
result.GetRequiredValue(
ToolInstallCommandParser
.AddSourceOption).First().Should().Be(expectedSourceValue);
70
result.GetRequiredValue(
ToolInstallCommandParser
.AddSourceOption)[0].Should().Be(expectedSourceValue1);
71
result.GetRequiredValue(
ToolInstallCommandParser
.AddSourceOption)[1].Should().Be(expectedSourceValue2);
79
result.GetRequiredValue(
ToolInstallCommandParser
.GlobalOption).Should().Be(true);
87
result.GetRequiredValue(
ToolInstallCommandParser
.LocalOption).Should().Be(true);
97
result.GetRequiredValue(
ToolInstallCommandParser
.ToolManifestOption).Should().Be("folder/my-manifest.format");
107
Enum.GetName(result.GetRequiredValue(
ToolInstallCommandParser
.VerbosityOption)).Should().Be(expectedVerbosityLevel);
116
result.GetRequiredValue(
ToolInstallCommandParser
.ToolPathOption).Should().Be(@"C:\Tools");
CommandTests\Tool\Update\UpdateToolParserTests.cs (11)
31
var packageVersion = packageIdentity?.VersionRange?.OriginalString ?? result.GetValue(
ToolInstallCommandParser
.VersionOption);
52
result.GetValue(
ToolInstallCommandParser
.GlobalOption).Should().Be(true);
62
result.GetValue(
ToolInstallCommandParser
.ConfigOption).Should().Be(@"C:\TestAssetLocalNugetFeed");
63
result.GetValue(
ToolInstallCommandParser
.FrameworkOption).Should().Be(ToolsetInfo.CurrentTargetFramework);
74
result.GetRequiredValue(
ToolInstallCommandParser
.AddSourceOption).First().Should().Be(expectedSourceValue);
89
result.GetValue(
ToolInstallCommandParser
.AddSourceOption).Should().BeEquivalentTo([expectedSourceValue1, expectedSourceValue2]);
100
Enum.GetName(result.GetValue(
ToolInstallCommandParser
.VerbosityOption)).Should().Be(expectedVerbosityLevel);
109
result.GetValue(
ToolInstallCommandParser
.ToolPathOption).Should().Be(@"C:\TestAssetLocalNugetFeed");
162
result.GetValue(
ToolInstallCommandParser
.VersionOption).Should().Be("1.2");
171
result.GetValue(
ToolInstallCommandParser
.LocalOption).Should().Be(true);
180
result.GetValue(
ToolInstallCommandParser
.ToolManifestOption).Should().Be(@"folder/my-manifest.format");