Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomic write support? #11

Closed
epage opened this issue Jun 9, 2023 · 1 comment
Closed

Atomic write support? #11

epage opened this issue Jun 9, 2023 · 1 comment

Comments

@epage
Copy link
Collaborator

epage commented Jun 9, 2023

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.

@aj-bagwell
Copy link
Owner

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants