-
Notifications
You must be signed in to change notification settings - Fork 14k
rustdoc-json: Make -o/--output control file, not directory
#149365
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
base: main
Are you sure you want to change the base?
Conversation
Historically in rustdoc, `-o`, `--out-dir` and `--output` all controlled the output directory, as rustdoc produced many HTML files, so it didn't make sense to give the path to an individual one. This doesn't make sense for rustdoc-json, where only a single file is produced. This commit makes `-o`/`--output` give a path to a file, rather than a directory. `--out-dir` is uneffected. This commit doesn't effect the HTML behaviour. Works towards https://www.github.com/rust-lang/rust/issues/142370 and https://www.github.com/rust-lang/cargo/issues/16291. Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/rustdoc-json.20output.20filename.20design/with/560468799
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
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.
Having an alternative here: #83784 (comment).
What about we expanding --emit to have per-emit-type output path. That is pretty similar to rustc --emit. Having a similar behavior across for the same CLI options could be a win and lower the learning cost. That we also can cut off two CLI options (--output-format and this --output options)
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.
Hmmm, that's worth at least considering. It might also resolve that --output-format=json is used both for "major mode" settings like json and doctest, but also "minor mode" like when giving doc-coverage information.
Historically in rustdoc,
-o,--out-dirand--outputall controlled the output directory, as rustdoc produced many HTML files, so it didn't make sense to give the path to an individual one.This doesn't make sense for rustdoc-json, where only a single file is produced. This commit makes
-o/--outputgive a path to a file, rather than a directory.--out-diris uneffected. This commit doesn't effect the HTML behaviour.Works towards #142370 and rust-lang/cargo#16291. Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/rustdoc-json.20output.20filename.20design/with/560468799
r? @GuillaumeGomez CC @weihanglo
TODO