Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Common new-type wrapper for more precise arguments #190

Open
aomader opened this issue Jun 28, 2016 · 0 comments
Open

Common new-type wrapper for more precise arguments #190

aomader opened this issue Jun 28, 2016 · 0 comments

Comments

@aomader
Copy link

aomader commented Jun 28, 2016

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.

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

No branches or pull requests

1 participant