Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #21631 by improving error messages #288

Merged

Conversation

ras0219-msft
Copy link
Contributor

@ras0219-msft ras0219-msft commented Nov 30, 2021

Fixes microsoft/vcpkg#21631

Fundamentally, this bad experience was driven by trying to use the generic argument parser for two different commands based on hidden runtime information. I've chosen to resolve this issue by accepting the superset of behavior and provide more specific error messages when the superset does not apply to this case.

Before:

/workspaces/manifest $ vcpkg install zlib
Error: 'install' requires 0 arguments, but 1 were provided.
Example:
  vcpkg install --triplet x64-windows

Options:
  --dry-run                       Do not actually build or install
  --head                          Install the libraries on the command line using the latest
                                  upstream sources
...

After:

/workspaces/manifest $ vcpkg install zlib
Error: In manifest mode, `vcpkg install` does not support individual package arguments.
To install additional packages, edit vcpkg.json and then run `vcpkg install` without any package arguments.
See https://github.com/Microsoft/vcpkg/tree/master/docs/users/manifest.md for more information.
Using manifest file at /workspaces/manifest/vcpkg.json.

Example:
  vcpkg install --triplet x64-windows

Options:
  --dry-run                       Do not actually build or install
  --head                          Install the libraries on the command line using the latest
                                  upstream sources (classic mode)
...

@BillyONeal
Copy link
Member

Hmmm this is an improvement but it leaves the help block very confused :(. I understand truly fixing that is going to require a more extensive overhaul though :(

@ras0219-msft ras0219-msft merged commit 0516f5f into microsoft:main Nov 30, 2021
@ras0219-msft
Copy link
Contributor Author

I tried to minimize the confusion of the help block by adding a note for the "exclusive" options (head, editable, no-default-features, feature)

@ras0219-msft ras0219-msft deleted the dev/roschuma/install-manifest-error branch November 30, 2021 22:42
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.

[manifest] Add diagnostic information to prompt the user
2 participants