-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[Feature Request] If No Package is installed and --x-json is specified, vcpkg list should be empty #13637
Labels
category:vcpkg-feature
The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Comments
The original message may be useful for users, however, show output as {} (an Empty Object) also make sense, @strega-nil, could you help confirm this issue? |
This makes sense to me, although I'd do |
Yeah that would be the better method Sorry |
Do you want to open a PR? |
pratikpc
added a commit
to pratikpc/vcpkg
that referenced
this issue
Sep 22, 2020
Thanks to @strega-nil for recommending using Json::stringify over my initial idea of simply printing an empty object Closes microsoft#13637
@strega-nil just opened a PR |
ras0219-msft
pushed a commit
that referenced
this issue
Sep 24, 2020
…3667) Thanks to @strega-nil for recommending using Json::stringify over my initial idea of simply printing an empty object Closes #13637
strega-nil
pushed a commit
to strega-nil/vcpkg
that referenced
this issue
May 5, 2021
…crosoft#13667) Thanks to @strega-nil for recommending using Json::stringify over my initial idea of simply printing an empty object Closes microsoft#13637
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
category:vcpkg-feature
The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Is your feature request related to a problem? Please describe.
A bit of an annoyance
I was writing an app of sorts that more tightly integrates vcpkg and CMake
During that, for obvious reasons, I had to access vcpkg list
So as I was developing an app, I used vcpkg list --x-json
When packages are Installed, output is
{
...blah blah blah
Useful info
}
When nothing is installed
Output is
No packages are installed. Did you mean
search?
Proposed solution
Show output as
{}
(an Empty Object)Describe alternatives you've considered
On my side, I am checking for an Exception from JSON.parse currently
Additional context
Not really
It's also experimental so unstable behaviour is both fair and expected
Edit:-
Fixing This
The place to fix this would be
vcpkg/toolsrc/src/vcpkg/commands.list.cpp
Line 96 in 2a6442c
Out here if JSON Mode is enabled, it should output {}
Should I create a PR?
I can help out here
The text was updated successfully, but these errors were encountered: