68 references to ToolInstallCommandParser
dotnet (45)
Commands\Tool\Common\ToolAppliedOption.cs (1)
39= ToolInstallCommandParser.VersionOption
Commands\Tool\Execute\ToolExecuteCommandParser.cs (8)
12public static readonly Argument<PackageIdentityWithRange> PackageIdentityArgument = ToolInstallCommandParser.PackageIdentityArgument; 19public static readonly Option<string> VersionOption = ToolInstallCommandParser.VersionOption; 20public static readonly Option<bool> RollForwardOption = ToolInstallCommandParser.RollForwardOption; 21public static readonly Option<bool> PrereleaseOption = ToolInstallCommandParser.PrereleaseOption; 22public static readonly Option<string> ConfigOption = ToolInstallCommandParser.ConfigOption; 23public static readonly Option<string[]> SourceOption = ToolInstallCommandParser.SourceOption; 24public static readonly Option<string[]> AddSourceOption = ToolInstallCommandParser.AddSourceOption; 27public static readonly Option<Utils.VerbosityOptions> VerbosityOption = ToolInstallCommandParser.VerbosityOption;
Commands\Tool\Install\ParseResultExtension.cs (3)
14var packageVersionFromIdentityArgument = parseResult.GetValue(ToolInstallCommandParser.PackageIdentityArgument).VersionRange?.OriginalString; 15var packageVersionFromVersionOption = parseResult.GetValue(ToolInstallCommandParser.VersionOption); 25bool prerelease = parseResult.GetValue(ToolInstallCommandParser.PrereleaseOption);
Commands\Tool\Install\ToolInstallCommand.cs (3)
19private readonly bool _global = parseResult.GetValue(ToolInstallCommandParser.GlobalOption); 20private readonly string _toolPath = parseResult.GetValue(ToolInstallCommandParser.ToolPathOption); 21private readonly string _framework = parseResult.GetValue(ToolInstallCommandParser.FrameworkOption);
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (14)
70var 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()); 88var configOption = parseResult.GetValue(ToolInstallCommandParser.ConfigOption); 89var sourceOption = parseResult.GetValue(ToolInstallCommandParser.AddSourceOption); 99_allowRollForward = parseResult.GetValue(ToolInstallCommandParser.RollForwardOption); 101_allowPackageDowngrade = parseResult.GetValue(ToolInstallCommandParser.AllowPackageDowngradeOption);
Commands\Tool\Install\ToolInstallLocalCommand.cs (5)
49var 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)
15public static readonly Option<string> ConfigOption = ToolInstallCommandParser.ConfigOption; 17public static readonly Option<string[]> AddSourceOption = ToolInstallCommandParser.AddSourceOption; 21public static readonly Option<Utils.VerbosityOptions> VerbosityOption = ToolInstallCommandParser.VerbosityOption;
Commands\Tool\ToolCommandParser.cs (1)
34command.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)
16public static readonly Option<bool> AllowPackageDowngradeOption = ToolInstallCommandParser.AllowPackageDowngradeOption; 31ToolInstallCommandParser.AddCommandOptions(command);
dotnet.Tests (23)
CommandTests\Tool\Install\InstallToolParserTests.cs (12)
28var packageIdentity = result.GetValue(ToolInstallCommandParser.PackageIdentityArgument); 30var packageVersion = packageIdentity.VersionRange?.OriginalString ?? result.GetValue(ToolInstallCommandParser.VersionOption); 42result.GetRequiredValue(ToolInstallCommandParser.ConfigOption).Should().Be(@"C:\TestAssetLocalNugetFeed"); 43result.GetRequiredValue(ToolInstallCommandParser.FrameworkOption).Should().Be(ToolsetInfo.CurrentTargetFramework); 54result.GetRequiredValue(ToolInstallCommandParser.AddSourceOption).First().Should().Be(expectedSourceValue); 70result.GetRequiredValue(ToolInstallCommandParser.AddSourceOption)[0].Should().Be(expectedSourceValue1); 71result.GetRequiredValue(ToolInstallCommandParser.AddSourceOption)[1].Should().Be(expectedSourceValue2); 79result.GetRequiredValue(ToolInstallCommandParser.GlobalOption).Should().Be(true); 87result.GetRequiredValue(ToolInstallCommandParser.LocalOption).Should().Be(true); 97result.GetRequiredValue(ToolInstallCommandParser.ToolManifestOption).Should().Be("folder/my-manifest.format"); 107Enum.GetName(result.GetRequiredValue(ToolInstallCommandParser.VerbosityOption)).Should().Be(expectedVerbosityLevel); 116result.GetRequiredValue(ToolInstallCommandParser.ToolPathOption).Should().Be(@"C:\Tools");
CommandTests\Tool\Update\UpdateToolParserTests.cs (11)
31var packageVersion = packageIdentity?.VersionRange?.OriginalString ?? result.GetValue(ToolInstallCommandParser.VersionOption); 52result.GetValue(ToolInstallCommandParser.GlobalOption).Should().Be(true); 62result.GetValue(ToolInstallCommandParser.ConfigOption).Should().Be(@"C:\TestAssetLocalNugetFeed"); 63result.GetValue(ToolInstallCommandParser.FrameworkOption).Should().Be(ToolsetInfo.CurrentTargetFramework); 74result.GetRequiredValue(ToolInstallCommandParser.AddSourceOption).First().Should().Be(expectedSourceValue); 89result.GetValue(ToolInstallCommandParser.AddSourceOption).Should().BeEquivalentTo([expectedSourceValue1, expectedSourceValue2]); 100Enum.GetName(result.GetValue(ToolInstallCommandParser.VerbosityOption)).Should().Be(expectedVerbosityLevel); 109result.GetValue(ToolInstallCommandParser.ToolPathOption).Should().Be(@"C:\TestAssetLocalNugetFeed"); 162result.GetValue(ToolInstallCommandParser.VersionOption).Should().Be("1.2"); 171result.GetValue(ToolInstallCommandParser.LocalOption).Should().Be(true); 180result.GetValue(ToolInstallCommandParser.ToolManifestOption).Should().Be(@"folder/my-manifest.format");