Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 17, 2025

Implementation Plan: Make nologo switch a boolean parameter

Analysis Complete:

  • Explored repository structure and existing code
  • Built the project successfully
  • Tested current nologo behavior (parameterless switch)
  • Identified key files to modify

Implementation Complete:

  • Move nologo from ParameterlessSwitch to ParameterizedSwitch in CommandLineSwitches.cs
  • Add nologo entry to parameterized switches map with boolean support
  • Update XMake.cs to process nologo as a boolean switch using ProcessBooleanSwitch
  • Update tests to handle new boolean behavior
  • Add tests for -nologo:false functionality
  • Add resource string for invalid nologo value error (MSB1071)
  • Update help message to document boolean parameter support ✨
  • Fix failing BinaryLoggerTests.SuppressCommandOutputForNonDiagVerbosity test 🔧
  • Verify that:
    • No parameter (-nologo) defaults to true
    • -nologo:false displays the logo
    • -nologo:true hides the logo (same as -nologo)
    • Unspecified means false (show logo by default)
    • Invalid values show proper error message

Files Modified:

  • src/MSBuild/CommandLineSwitches.cs - Moved nologo to parameterized switches
  • src/MSBuild/XMake.cs - Updated processing logic for boolean nologo
  • src/MSBuild/Resources/Strings.resx - Added InvalidNoLogoValue error message and updated help text
  • src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs - Updated and added tests
  • src/Build.UnitTests/BinaryLogger_Tests.cs - Fixed test expectation for switch order

Manual Testing Results:

  • ✅ Default behavior: Shows logo
  • -nologo: Hides logo
  • -nologo:true: Hides logo
  • -nologo:false: Shows logo
  • -nologo:invalid: Shows MSB1071 error
  • ✅ All NoLogo tests pass
  • ✅ BinaryLoggerTests.SuppressCommandOutputForNonDiagVerbosity test passes
  • ✅ Help message documents -noLogo[:true|false] syntax

Test Fix Details:

Fixed the failing BinaryLoggerTests.SuppressCommandOutputForNonDiagVerbosity test by updating the expected command line order. Since nologo moved from parameterless to parameterized, it now appears in alphabetical order with other parameterized switches:

Before: -nologo -bl:... -verbosity:diag
After: -bl:... -nologo -verbosity:diag

The implementation is complete and all tests are passing.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Make the nologo switch a bool, which is false when unspecified, true when specified with no value (as it is today), but able to accept -nologo:false and display the logo. Make nologo switch accept boolean values to enable explicit logo display control Sep 17, 2025
Copilot finished work on behalf of rainersigwald September 17, 2025 14:00
@Copilot Copilot AI requested a review from rainersigwald September 17, 2025 14:00
new ParameterizedSwitchInfo( ["featureAvailability", "fa"], ParameterizedSwitch.FeatureAvailability, null, true, "MissingFeatureAvailabilityError", true, false, "HelpMessage_46_FeatureAvailabilitySwitch"),
new ParameterizedSwitchInfo( ["multithreaded", "mt"], ParameterizedSwitch.MultiThreaded, null, false, null, true, false, "HelpMessage_49_MultiThreadedSwitch")
new ParameterizedSwitchInfo( ["multithreaded", "mt"], ParameterizedSwitch.MultiThreaded, null, false, null, true, false, "HelpMessage_49_MultiThreadedSwitch"),
new ParameterizedSwitchInfo( ["nologo"], ParameterizedSwitch.NoLogo, null, false, null, true, false, "HelpMessage_5_NoLogoSwitch")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot update HelpMessage_5_NoLogoSwitch to mention that you can also pass -nologo:false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the help message to document the boolean parameter support. The help text now shows -noLogo[:true|false] and explicitly mentions that users can specify -nologo:false to show the logo. (c3b9b87)

@rainersigwald
Copy link
Member

@copilot fix the failing test Microsoft.Build.UnitTests.BinaryLoggerTests.SuppressCommandOutputForNonDiagVerbosity

… adjust for nologo switch order

Co-authored-by: rainersigwald <[email protected]>
Copy link
Contributor Author

Copilot AI commented Sep 17, 2025

@copilot fix the failing test Microsoft.Build.UnitTests.BinaryLoggerTests.SuppressCommandOutputForNonDiagVerbosity

Fixed the failing test by updating the expected command line switch order. Since nologo moved from parameterless to parameterized, it now appears alphabetically with other parameterized switches rather than first. Updated test expectations accordingly. (53e44d8)

Copilot finished work on behalf of rainersigwald September 17, 2025 19:09
@rainersigwald rainersigwald marked this pull request as ready for review September 22, 2025 16:08
@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 16:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the nologo MSBuild command-line switch to accept boolean parameters, enabling explicit control over logo display. Previously, nologo was a parameterless switch that could only suppress the logo. Now it supports -nologo:false to explicitly show the logo and -nologo:true (equivalent to -nologo) to suppress it.

Key changes:

  • Migrated nologo from parameterless to parameterized switch architecture
  • Added boolean parameter processing with proper error handling for invalid values
  • Updated help documentation to reflect new syntax options

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/MSBuild/XMake.cs Updated logo processing logic to handle parameterized boolean nologo switch
src/MSBuild/CommandLineSwitches.cs Moved nologo from parameterless to parameterized switch enumeration
src/MSBuild/Resources/Strings.resx Added error message for invalid nologo values and updated help text
src/MSBuild/Resources/xlf/*.xlf Updated localization files with new help text and error message
src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs Updated and added tests for new boolean nologo behavior
src/Build.UnitTests/BinaryLogger_Tests.cs Fixed test expectations to account for switch ordering changes

@rainersigwald rainersigwald enabled auto-merge (squash) September 22, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants