Skip to content

Outputting rustdoc JSON output to stdout instead of file when invoked via cargo #14672

@Boscop

Description

@Boscop

Right now it seems impossible to output the rustdoc JSON output to stdout when it's invoked via cargo, it can only output to a file.

E.g. this produces a JSON file:

cargo +nightly rustdoc -- --output-format json -Z unstable-options

One would expect that this would work to output to stdout

cargo +nightly rustdoc -- --output-format json -Z unstable-options -o -

but unfortunately it doesn't. Instead it gives an error:

error: Option 'out-dir' given more than once

It would be nice if it was possible to output the whole rustdoc JSON output for a crate and all its deps to stdout instead of to a file 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-rustdocS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions