rustdoc-json: Make -o/--output control file, not directory#149365
rustdoc-json: Make -o/--output control file, not directory#149365aDotInTheVoid wants to merge 2 commits intorust-lang:mainfrom
-o/--output control file, not directory#149365Conversation
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.
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.
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.
| -w, --output-format [html] | ||
| the output type to write | ||
| --output PATH Which directory to place the output. This option is | ||
| -o, --output PATH Which directory to place the output. This option is |
There was a problem hiding this comment.
Is it still deprecated then?
|
Thanks for the PR! I'm glad someone finally had time to work on this. ^^' So I guess |
|
☔ The latest upstream changes (presumably #150912) made this pull request unmergeable. Please resolve the merge conflicts. |
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