use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use std::process::ExitCode; use std::str::FromStr; use std::sync::atomic::{AtomicUsize, Ordering}; use mdtidy::{Options, Preset}; const HELP: &str = "\ mdtidy: a fast Markdown formatter Usage $ mdtidy [paths...] [options] Without paths, reads stdin and prints the result. With one file, prints the result unless --check or --write is set. Folders are searched for .md and .markdown files. Options --check List files that aren't formatted, and exit 1 if any -w, --write Rewrite files in place --preset prettier (default) or preserve --width Line width (default: 80) --wrap preserve, always, or never --bullet keep, dash, asterisk, or plus --emphasis keep, underscore, or asterisk --strong keep, asterisk, or underscore --numbering keep or auto --rule keep, dash, asterisk, or underscore --fence keep, backtick, or tilde --heading