microsoft / vswhere

Locate Visual Studio 2017 and newer installations
MIT License
921 stars 97 forks source link

`-path` flag does not appear in usage #273

Closed lacasseio closed 1 year ago

lacasseio commented 2 years ago

The -path flag usage was removed from the RC file in this commit. This flag seems to be exactly what we need, but I saw it disappear from the help:

Version 2.7.1

Visual Studio Locator version 2.7.1+180c706d56 [query version 2.7.3111.17308]
Copyright (C) Microsoft Corporation. All rights reserved.

Usage:  [options]

Selection options:
  -all           Finds all instances even if they are incomplete and may not launch.
  -prerelease    Also searches prereleases. By default, only releases are searched.
  -products arg  One or more product IDs to find. Defaults to Community, Professional, and Enterprise.
                 Specify "*" by itself to search all product instances installed.
                 See https://aka.ms/vs/workloads for a list of product IDs.
  -requires arg  One or more workload or component IDs required when finding instances.
                 All specified IDs must be installed unless -requiresAny is specified.
                 See https://aka.ms/vs/workloads for a list of workload and component IDs.
  -requiresAny   Find instances with any one or more workload or components IDs passed to -requires.
  -version arg   A version range for instances to find. Example: [15.0,16.0) will find versions 15.*.
  -latest        Return only the newest version and last installed.
  -legacy        Also searches Visual Studio 2015 and older products. Information is limited.
                 This option cannot be used with either -products or -requires.
  -path arg      Gets the instance for the current path. Not compatible with any other selection option.
[...]

Version 3.0.3

Visual Studio Locator version 3.0.3+45247720e1 [query version 2.7.3111.17308]
Copyright (C) Microsoft Corporation. All rights reserved.

Usage:  [options]

Options:
  -all           Finds instances in complete, launchable, and incomplete states. By default, only instances
                 in a complete state - no errors or reboot required - are searched.
  -prerelease    Also searches prereleases. By default, only releases are searched.
  -products arg  One or more product IDs to find. Defaults to Community, Professional, and Enterprise.
                 Specify "*" by itself to search all product instances installed.
                 See https://aka.ms/vs/workloads for a list of product IDs.
  -requires arg  One or more workload or component IDs required when finding instances.
                 All specified IDs must be installed unless -requiresAny is specified.
                 See https://aka.ms/vs/workloads for a list of workload and component IDs.
  -requiresAny   Find instances with any one or more workload or components IDs passed to -requires.
  -version arg   A version range for instances to find. Example: [15.0,16.0) will find versions 15.*.
  -latest        Return only the newest version and last installed.
  -sort          Sorts the instances from newest version and last installed to oldest.
                 When used with "find", first instances are sorted then files are sorted lexigraphically.
  -legacy        Also searches Visual Studio 2015 and older products. Information is limited.
                 This option cannot be used with either -products or -requires.
  -format arg    Return information about instances found in a format described below.
  -property arg  The name of a property to return. Defaults to "value" format.
                 Use delimiters ".", "/", or "_" to separate object and property names.
                 Example: "properties.nickname" will return the "nickname" property under "properties".
  -include arg   One or more extra properties to include, as described below.
  -find arg      Returns matching file paths under the installation path. Defaults to "value" format.
                 The following patterns are supported:
                 ?  Matches any one character except "\".
                 *  Matches zero or more characters except "\".
                 ** Searches the current directory and subdirectories for the remaining search pattern.
  -nocolor       Do not print instances formatted with colors. By default, colors suitable for dark-themed
                 terminals (common) are output when printing to a terminal but not to a pipe.
  -nologo        Do not show logo information. Some formats noted below will not show a logo anyway.
  -utf8          Use UTF-8 encoding (recommended for JSON).
  -?, -h, -help  Display this help message.
[...]

I'm pretty sure it's just a bad merge or something similar because I couldn't find anything that would indicate the flag is being phased out.

heaths commented 2 years ago

Thanks for catching that. Yes, it's likely a bad merge since the .rc file gets treated as a binary file. I've tried a few ways to fix it, but either Git or VS doesn't like it when I do.

But, yes, -path is definitely supported and we'll be sure to get that added back, along with any others that might be accidentally missing.

This is a quick fix, but I want to talk with the VC folks and see what they recommend to help mitigate this issue going forward.

lacasseio commented 2 years ago

That's what I thought. I encountered the same issue when I was comparing the commits. Kind of disappointing that the .rc files are treated as binary files.

heaths commented 2 years ago

I followed up with the VC team and as of 16.3, UTF-8 .rc files should work fine now. I'll convert the file and make sure everything is working end to end in the course of fixing this.

heaths commented 1 year ago

This was resolved in #279. We'll release a new version soon.