Closed octotep closed 8 years ago
@octotep Sounds good ! I tend to do this as well. In fact, even the example for rpassword
does this.
I'm glad to review / merge a pull request if you have the time to do one. If you do, please include a unit test for the added function as well, at least for the platform you are using rpassword
on :smiley:
I was really hoping to take a crack at it last weekend, and then this weekend, but unfortunately I haven't had the time, and probably won't for the foreseeable future. Should anyone else have some time to work on it, feel free to do so.
Hi @octotep !
This took a long time but its finally here. I've added two methods that should fit the use case you were talking about (check example.rs for more details).
The link to the docs are broken but hopefully the function names are sufficiently clear.
I have found it to be very useful to print on stderr
instead of stdout
sometimes (for instance if you pipe the STDOUT of a command that prompts for a password, prompting on STDERR is a simple hack that allows the prompt to still show in the terminal despite the pipe), which is why I've put one function for each output stream.
Let me know what you think. I'll bump the crates.io version in a few minutes.
Conrad
I find myself writing code like this a lot:
It would be much nicer to instead write something like this instead:
Is this a feature that rustastic-password is interested in adding? I find it very convenient and have it defined as a function in my code, but I think it would make a great addition to the library.