-
-
Notifications
You must be signed in to change notification settings - Fork 671
Issue 18368 - -X should print all static information on stdout if no files are given #7840
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
Conversation
|
We should keep things orthogonal: where we output json (file vs stdout) and what (with or without input files):
|
No.
Ok. I will change to this soon. |
| json_info(&buf); | ||
| buf.writestring("\n"); | ||
| // write to stdout for -X and -Xf=- | ||
| if (!global.params.jsonfilename || strcmp(global.params.jsonfilename, "-") == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If wanted I can split this if statement and print the manual for -X (previous behavior).
|
what i meant was: |
|
FYI #7838 comes with the same behavior and actually already does what this PR was trying to do, so let's better move the discussion to that PR. |
Based on the discussion in #7521, dlang/tools#292 and #7838 the conclusion was the following:
-Xqwill allow querying (see Added -Xi to include new fields in JSON output #7838)-Xshould support printing to stdout if no files are given to satisfy the probing use case from Implement -probe for showing supported features #7521This is a simple version to get approval of the concept.
Moving over the full attributes from #7521 will be easy and can be done as a follow-up as for now this feature is undocumented.
As you might have noticed, this would also require refactoring the JsonWriter.