rustdoc-json: Make -o/--output control file, not directory by aDotInTheVoid · Pull Request #149365 · rust-lang/rust (original) (raw)

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 #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