110 references to ParameterlessSwitch
Microsoft.Build.CommandLine.UnitTests (49)
CommandLineSwitches_Tests.cs (49)
37CommandLineSwitches.ParameterlessSwitch parameterlessSwitch; 41parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.Invalid); 67CommandLineSwitches.IsParameterlessSwitch(help, out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, out string duplicateSwitchErrorMessage).ShouldBeTrue(); 68parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.Help); 81CommandLineSwitches.IsParameterlessSwitch(version, out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, out string duplicateSwitchErrorMessage).ShouldBeTrue(); 82parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.Version); 92CommandLineSwitches.IsParameterlessSwitch(nologo, out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, out string duplicateSwitchErrorMessage).ShouldBeTrue(); 93parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.NoLogo); 106CommandLineSwitches.IsParameterlessSwitch(noautoresponse, out CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, out string duplicateSwitchErrorMessage).ShouldBeTrue(); 107parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.NoAutoResponse); 120CommandLineSwitches.ParameterlessSwitch parameterlessSwitch; 124parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger); 136CommandLineSwitches.ParameterlessSwitch parameterlessSwitch; 140parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.FileLogger); 152CommandLineSwitches.ParameterlessSwitch parameterlessSwitch; 156parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterlessSwitch.DistributedFileLogger); 749switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoLogo, "/nologo"); 751Assert.Equal("/nologo", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoLogo)); 752Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoLogo)); 753Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.NoLogo]); 756switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoLogo, "-NOLOGO"); 758Assert.Equal("-NOLOGO", switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoLogo)); 759Assert.True(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoLogo)); 760Assert.True(switches[CommandLineSwitches.ParameterlessSwitch.NoLogo]); 763Assert.Null(switches.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Version)); 764Assert.False(switches.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Version)); 765Assert.False(switches[CommandLineSwitches.ParameterlessSwitch.Version]); 968switchesLeft.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.Help, "/?"); 970Assert.True(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); 971Assert.False(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 975switchesRight1.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger, "/noconlog"); 977Assert.False(switchesRight1.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); 978Assert.True(switchesRight1.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 982Assert.Equal("/noconlog", switchesLeft.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 983Assert.True(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 984Assert.True(switchesLeft[CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger]); 987Assert.Equal("/?", switchesLeft.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Help)); 988Assert.True(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); 989Assert.True(switchesLeft[CommandLineSwitches.ParameterlessSwitch.Help]); 993switchesRight2.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger, "/NOCONSOLELOGGER"); 995Assert.False(switchesRight2.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); 996Assert.True(switchesRight2.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 1000Assert.Equal("/NOCONSOLELOGGER", switchesLeft.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 1001Assert.True(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger)); 1002Assert.True(switchesLeft[CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger]); 1004Assert.Equal("/?", switchesLeft.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.Help)); 1005Assert.True(switchesLeft.IsParameterlessSwitchSet(CommandLineSwitches.ParameterlessSwitch.Help)); 1006Assert.True(switchesLeft[CommandLineSwitches.ParameterlessSwitch.Help]); 1219switches.SetParameterlessSwitch(CommandLineSwitches.ParameterlessSwitch.Help, "/?");
MSBuild (61)
CommandLineSwitches.cs (47)
141ParameterlessSwitch parameterlessSwitch, 157internal ParameterlessSwitch parameterlessSwitch; 216new ParameterlessSwitchInfo( ["help", "h", "?"], ParameterlessSwitch.Help, null, "HelpMessage_4_HelpSwitch"), 217new ParameterlessSwitchInfo( ["version", "ver"], ParameterlessSwitch.Version, null, "HelpMessage_6_VersionSwitch"), 218new ParameterlessSwitchInfo( ["nologo"], ParameterlessSwitch.NoLogo, null, "HelpMessage_5_NoLogoSwitch"), 219new ParameterlessSwitchInfo( ["noautoresponse", "noautorsp"], ParameterlessSwitch.NoAutoResponse, null, "HelpMessage_8_NoAutoResponseSwitch"), 220new ParameterlessSwitchInfo( ["noconsolelogger", "noconlog"], ParameterlessSwitch.NoConsoleLogger, null, "HelpMessage_14_NoConsoleLoggerSwitch"), 221new ParameterlessSwitchInfo( ["filelogger", "fl"], ParameterlessSwitch.FileLogger, null, "HelpMessage_20_FileLoggerSwitch"), 222new ParameterlessSwitchInfo( ["filelogger1", "fl1"], ParameterlessSwitch.FileLogger1, null, "HelpMessage_20_FileLoggerSwitch"), 223new ParameterlessSwitchInfo( ["filelogger2", "fl2"], ParameterlessSwitch.FileLogger2, null, "HelpMessage_20_FileLoggerSwitch"), 224new ParameterlessSwitchInfo( ["filelogger3", "fl3"], ParameterlessSwitch.FileLogger3, null, "HelpMessage_20_FileLoggerSwitch"), 225new ParameterlessSwitchInfo( ["filelogger4", "fl4"], ParameterlessSwitch.FileLogger4, null, "HelpMessage_20_FileLoggerSwitch"), 226new ParameterlessSwitchInfo( ["filelogger5", "fl5"], ParameterlessSwitch.FileLogger5, null, "HelpMessage_20_FileLoggerSwitch"), 227new ParameterlessSwitchInfo( ["filelogger6", "fl6"], ParameterlessSwitch.FileLogger6, null, "HelpMessage_20_FileLoggerSwitch"), 228new ParameterlessSwitchInfo( ["filelogger7", "fl7"], ParameterlessSwitch.FileLogger7, null, "HelpMessage_20_FileLoggerSwitch"), 229new ParameterlessSwitchInfo( ["filelogger8", "fl8"], ParameterlessSwitch.FileLogger8, null, "HelpMessage_20_FileLoggerSwitch"), 230new ParameterlessSwitchInfo( ["filelogger9", "fl9"], ParameterlessSwitch.FileLogger9, null, "HelpMessage_20_FileLoggerSwitch"), 231new ParameterlessSwitchInfo( ["distributedfilelogger", "dfl"], ParameterlessSwitch.DistributedFileLogger, null, "HelpMessage_21_DistributedFileLoggerSwitch"), 233new ParameterlessSwitchInfo( ["waitfordebugger", "wfd"], ParameterlessSwitch.WaitForDebugger, null, null), 311out ParameterlessSwitch parameterlessSwitch, 314parameterlessSwitch = ParameterlessSwitch.Invalid; 450Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 459if (s_parameterlessSwitchesMap[i].parameterlessSwitch is not ParameterlessSwitch.WaitForDebugger) 476_parameterlessSwitches = new DetectedParameterlessSwitch[(int)ParameterlessSwitch.NumberOfParameterlessSwitches]; 484internal void SetParameterlessSwitch(ParameterlessSwitch parameterlessSwitch, string commandLineArg) 586if (IsParameterlessSwitchSet((ParameterlessSwitch)i)) 588commandLineA.Add(GetParameterlessSwitchCommandLineArg((ParameterlessSwitch)i)); 611internal bool IsParameterlessSwitchSet(ParameterlessSwitch parameterlessSwitch) 624internal bool this[ParameterlessSwitch parameterlessSwitch] 637internal string GetParameterlessSwitchCommandLineArg(ParameterlessSwitch parameterlessSwitch) 694groupedFileLoggerParameters[0] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger, ParameterizedSwitch.FileLoggerParameters); 695groupedFileLoggerParameters[1] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger1, ParameterizedSwitch.FileLoggerParameters1); 696groupedFileLoggerParameters[2] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger2, ParameterizedSwitch.FileLoggerParameters2); 697groupedFileLoggerParameters[3] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger3, ParameterizedSwitch.FileLoggerParameters3); 698groupedFileLoggerParameters[4] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger4, ParameterizedSwitch.FileLoggerParameters4); 699groupedFileLoggerParameters[5] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger5, ParameterizedSwitch.FileLoggerParameters5); 700groupedFileLoggerParameters[6] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger6, ParameterizedSwitch.FileLoggerParameters6); 701groupedFileLoggerParameters[7] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger7, ParameterizedSwitch.FileLoggerParameters7); 702groupedFileLoggerParameters[8] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger8, ParameterizedSwitch.FileLoggerParameters8); 703groupedFileLoggerParameters[9] = GetSpecificFileLoggerParameters(ParameterlessSwitch.FileLogger9, ParameterizedSwitch.FileLoggerParameters9); 738private string[] GetSpecificFileLoggerParameters(ParameterlessSwitch parameterlessSwitch, ParameterizedSwitch parameterizedSwitch) 770for (int i = 0; i < (int)ParameterlessSwitch.NumberOfParameterlessSwitches; i++) 772if (IsParameterlessSwitchSet((ParameterlessSwitch)i)) 928for (int i = 0; i < (int)ParameterlessSwitch.NumberOfParameterlessSwitches; i++) 930if (switchesToAppend.IsParameterlessSwitchSet((ParameterlessSwitch)i)) 932if (!IsParameterlessSwitchSet((ParameterlessSwitch)i) || 940switchesToAppend.GetParameterlessSwitchCommandLineArg((ParameterlessSwitch)i), commandLine);
XMake.cs (14)
326if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Help] || 328commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Version] || 2017if (!switchesNotFromAutoResponseFile[CommandLineSwitches.ParameterlessSwitch.NoAutoResponse]) 2105if (CommandLineSwitches.IsParameterlessSwitch(switchName, out var parameterlessSwitch, out var duplicateSwitchErrorMessage)) 2300CommandLineSwitches.ParameterlessSwitch parameterlessSwitch, 2450if (switchesFromAutoResponseFile[CommandLineSwitches.ParameterlessSwitch.NoAutoResponse]) 2453switchesFromAutoResponseFile.GetParameterlessSwitchCommandLineArg(CommandLineSwitches.ParameterlessSwitch.NoAutoResponse), commandLine); 2524if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.WaitForDebugger]) 2576if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Help]) 2590if (commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Version]) 2746commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoConsoleLogger], 2747commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.DistributedFileLogger], 3059if (!recursing && !commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoAutoResponse]) 4567bool shouldShowLogo = !commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.NoLogo] &&