You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
Writing a CLI it is quite common to work with paths. However, there is currently no easy and default way to specify certain constraints without implementing something individual. Therefore, I propose to implement common new-type wrappers to support the most used constraints on CLI arguments.
From the top of my head I think about something like these types, with appropriate Decodable implementations:
struct ExistingFile(PathBuf);
struct WritableFile(PathBuf);
struct WritableDirectory(PathBuf);
This seems as it would solve most of current issues like #152, #135.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Writing a CLI it is quite common to work with paths. However, there is currently no easy and default way to specify certain constraints without implementing something individual. Therefore, I propose to implement common new-type wrappers to support the most used constraints on CLI arguments.
From the top of my head I think about something like these types, with appropriate
Decodable
implementations:struct ExistingFile(PathBuf);
struct WritableFile(PathBuf);
struct WritableDirectory(PathBuf);
This seems as it would solve most of current issues like #152, #135.
The text was updated successfully, but these errors were encountered: