Skip to content

Update documentation on stdin input with rustfmt #4336

Closed
@calebcartwright

Description

@calebcartwright

rustfmt supports formatting files as well as rust code provided via stdin. However, the readme documentation and rustfmt --help description text could use some updates to make this explicitly clear, as well as call out that if you run rustfmt without specifying any files that rustfmt will be waiting for input from stdin.

This could be addressed by updating the running section in the readme, with more details and ideally some examples (e.g. echo "fn main ( ) { }" | rustfmt with stdout output from rustfmt), as well as updating the structopt info to provide more detail when users run rustfmt --help.

/// Format Rust code
#[derive(Debug, StructOpt, Clone)]
#[structopt(name = "rustfmt", version = include_str!(concat!(env!("OUT_DIR"),"/version-info.txt")))]
struct Opt {

https://docs.rs/structopt/0.3.15/structopt/#how-to-derivestructopt

If anyone is interested in working on this please leave a comment or ping us on Discord!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions