-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
No default_value_os for reliably specifying filesystem paths as default arguments #849
Comments
While I agree there could be a |
At the moment, it's more a matter of wanting correctness in how I glue the "get me the current directory" APIs to clap and wanting the APIs I deal with to be complete. However, there is actually a set of situations where I expect this to be a problem. Some of the projects I have on hold (currently partially prototyped in old Python code using (ie. Folders full of files with Japanese filenames names so mojibake'd that they're not even valid UTF-8) As-is, to play it safe in those projects, I'll be setting a dummy default value (probably |
One can now define default values that contain invalid UTF-8. The underlying implementation has also been changed to use OsStrs in order to avoid duplication of code and provide the new APIs basically for free. Closes #849
Oh wow! |
Thanks for letting me know, I'll get this added shortly! |
api(Arg): add `default_value_os` Also add related tests, and reframe `default_value` in terms of `defualt_value_os`. This resolves #849. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kbknapp/clap-rs/941) <!-- Reviewable:end -->
Affected Version of clap
2.20.3
Expected Behavior Summary
Functions like
validator_os
andvalue_of_os
should be complemented with adefault_value_os
.Actual Behavior Summary
Only
default_value
and its variants are provided... which means that it's not possible to specify all valid paths as default values.Sample Code or Link to Sample Code
(It's an excerpt from the "new project" boilerplate I'm putting together)
The text was updated successfully, but these errors were encountered: