Data-Oriented-House / PortableBuildTools

Portable VS Build Tools installer
595 stars 19 forks source link

cli should provide a way to enumerate vc and sdk versions #13

Closed milnak closed 3 months ago

milnak commented 3 months ago

e.g.

PortableBuildTools.exe listversions

would return:

{
    "msvc": [
        "14.40.17.10",
        "14.39.17.9 "
    ],
    "sdk": [
        "26100",
        "22621"
    ]
}
milnak commented 3 months ago

and maybe also return targetArch and hostArch enumerations as well?

SolarScuffle-Bot commented 3 months ago

Hikari says, "Very good suggestions on both issues, thank you. I'll make these behave properly with the next release."

j-begin commented 3 months ago

This has been added. Use CLI flag list.

Thank you.

milnak commented 3 months ago

Two issues: 1) CLI was removed so running "PortableBuildTools.exe" now starts installing without any prompt. Maybe that's desirable for some? 2) list returns items in a non easily parseable format which is why I suggested (and gave an example of a JSON format.

If "list" is provided, then no output like

Downloading manifest files...
[89kb] Manifest.Release.json
[110kb] Manifest.Preview.json

should occur and the output should be in json, e.g.

{
    "versions": {
        "msvc": {
            "release": [
                "14.30.17.0",
                "14.29.16.11"
            ],
            "preview": [
                "14.29.16.11",
                "14.30.17.0"
            ]
        },
        "sdk": {
            "release": [
                "19041",
                "18362"
            ],
            "preview": [
                "19041",
                "18362"
            ]
        }
    }
}

with all values preferably in descending order.

j-begin commented 3 months ago
  1. CLI now works as it does in the original python script, sets the variables and asks you for the confirmation, which you can skip with a flag, and you can set the variables to different values via flags too. It is less interactive on purpose, but it is still CLI that can be used in scripts. And now it doesn't require supplying cli flag, it auto-detects if you run it in a console or a script.

  2. If no output should occur, you would think you broke something, because you would have a blank screen to stare at for several seconds. As for "easily parsable" format, it depends on what you are parsing it with. Simple strings are way easier to parse than json in any programming language, and there is a separating blank line right before the values are printed, so your parser can just wait for the blank line, and start parsing after that. I will definitely not be making it into a json format. As for descending order - i will do that.

milnak commented 3 months ago

"Simple strings are way easier to parse than json in any programming language"

I beg to differ. String formatting breaks over time with changes. String parsing breaks if the text is localized. If simple strings are the way to go for data, why does the world have Json, xml, yaml, etc?

milnak commented 3 months ago

"If no output should occur, you would think you broke something"

Maybe send those strings to stderr then?