GithubHelp home page GithubHelp logo

Comments (10)

amanda-mitchell avatar amanda-mitchell commented on July 17, 2024

From my reading of the code, it appears that Windows accepts / or -, while Unix only accepts -. Given this, the simplest fix would be to replace / with - across the board in all help messages.

from msbuild.

akoeplinger avatar akoeplinger commented on July 17, 2024

I'd strongly vote for accepting / in the command line switches, otherwise migrating builds scripts from xbuild (which accepts /) will be a huge pain.

from msbuild.

amanda-mitchell avatar amanda-mitchell commented on July 17, 2024

@akoeplinger I believe the only thing needed to do for that approach would be to eliminate the #if block at https://github.com/Microsoft/msbuild/blob/f112881f2ef7647d964a92690e15d8613685e5a1/src/XMakeCommandLine/XMake.cs#L1295-1300

from msbuild.

AndyGerlicher avatar AndyGerlicher commented on July 17, 2024

MSBuild team triage: The change was done for simplicity to be able to determine if the parameter is a path or MSBuild switch, it's definitely more involved than just removing the #if block. We would accept the change if it included unit tests for the different scenarios (files, invalid parameters, etc.). We're also happy for the help text to be updated in the xplat branch either way.

from msbuild.

akoeplinger avatar akoeplinger commented on July 17, 2024

@AndyGerlicher is the only concern here that MSBuild would mistake a file named e.g. /nologo as a switch on Linux if we just removed the #if? That wouldn't sound like a compelling reason to me honestly :)

from msbuild.

ValMenn avatar ValMenn commented on July 17, 2024

@akoeplinger It has more to do with what happens when a path (that starts with a slash) is interpreted as a switch, only to determine that it is not valid (that's what would currently happen after the #if block is removed). Additional code needs to be added to check if the "bad" switch is in fact a file path. Your case (when a file path happens to be a valid switch) is less likely and may not be of concern as there is no easy way to handle this anyway.

from msbuild.

akoeplinger avatar akoeplinger commented on July 17, 2024

@ValMenn ok, thanks for your response. I'll take a look and see if I can come up with something here.

from msbuild.

akoeplinger avatar akoeplinger commented on July 17, 2024

I opened a PR that allows using / for switches: #91

from msbuild.

akoeplinger avatar akoeplinger commented on July 17, 2024

@david-mitchell since my PR was merged, I think the primary reason for this issue does no longer apply, so I think this can be closed. Or do you think we should still be recommending - prefix on Unix?

from msbuild.

amanda-mitchell avatar amanda-mitchell commented on July 17, 2024

@akoeplinger agreed.

from msbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.