Closed epage closed 1 year ago
This was a great idea! I have added it in version 0.3.0 to Output. You can make it atomic by specifying it in the clap anotation like you suggested.
/// Write output atomically using temp file and atomic rename
#[clap(value_parser = clap::value_parser!(Output).atomic())]
config_file: Output,
This looks very close to what I was hoping for for clap-rs/clap#4074.
One thing I thing click.File has that this doesn't is the ability to configure writes to be atomic.