diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli_interactor.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cli_interactor.rs b/src/cli_interactor.rs index 693e9fd..a702a54 100644 --- a/src/cli_interactor.rs +++ b/src/cli_interactor.rs | |||
| @@ -17,12 +17,12 @@ pub trait InteractorPrompt { | |||
| 17 | } | 17 | } |
| 18 | impl InteractorPrompt for Interactor { | 18 | impl InteractorPrompt for Interactor { |
| 19 | fn input(&self, parms: PromptInputParms) -> Result<String> { | 19 | fn input(&self, parms: PromptInputParms) -> Result<String> { |
| 20 | let input: String = Input::with_theme(&self.theme) | 20 | let mut input = Input::with_theme(&self.theme); |
| 21 | .with_prompt(parms.prompt) | 21 | input.with_prompt(parms.prompt).allow_empty(parms.optional); |
| 22 | .default(parms.default) | 22 | if !parms.default.is_empty() { |
| 23 | .allow_empty(parms.optional) | 23 | input.default(parms.default); |
| 24 | .interact_text()?; | 24 | } |
| 25 | Ok(input) | 25 | Ok(input.interact_text()?) |
| 26 | } | 26 | } |
| 27 | fn password(&self, parms: PromptPasswordParms) -> Result<String> { | 27 | fn password(&self, parms: PromptPasswordParms) -> Result<String> { |
| 28 | let mut p = Password::with_theme(&self.theme); | 28 | let mut p = Password::with_theme(&self.theme); |