Derive value_parser for Option<PasswordHashString>; empty string converts to None #6285
Unanswered
overhacked
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
You would need to set your type to |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've got a app that generates an ephemeral password if
--auth-token=TOKENis not supplied on the command line, but if the user explicitly supplies an empty auth token--auth-token="", then theOption<PasswordHashString>should be set toNone. I'm not currently able to accomplish this withvalue_parser, because it is expected to return the inner type.I found a reply from a few years ago by @epage that alludes there is a way to get a value_parser to return an
Option, but I couldn't find any more details. Do you have any suggestions?Beta Was this translation helpful? Give feedback.
All reactions