diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-01 00:00:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-01 00:00:00 +0000 |
| commit | 06be0bc44011411b78217459f505ed12281b32c4 (patch) | |
| tree | 36cab80e309d33f20fedcc97258700a379aa348e /src/cli_interactor.rs | |
| parent | 492cc67887855cecb3fb501c4b61af50bf645b73 (diff) | |
feat(prs-list) list and pull selected as branch
- fetch prs and present as a selectable list
- create and / or checkout branch for selected pr
- apply latest patches as commits
Diffstat (limited to 'src/cli_interactor.rs')
| -rw-r--r-- | src/cli_interactor.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cli_interactor.rs b/src/cli_interactor.rs index e52cefb..c6cd4e5 100644 --- a/src/cli_interactor.rs +++ b/src/cli_interactor.rs | |||
| @@ -40,6 +40,8 @@ impl InteractorPrompt for Interactor { | |||
| 40 | } | 40 | } |
| 41 | fn choice(&self, parms: PromptChoiceParms) -> Result<usize> { | 41 | fn choice(&self, parms: PromptChoiceParms) -> Result<usize> { |
| 42 | dialoguer::Select::with_theme(&self.theme) | 42 | dialoguer::Select::with_theme(&self.theme) |
| 43 | .with_prompt(parms.prompt) | ||
| 44 | .report(parms.report) | ||
| 43 | .items(&parms.choices) | 45 | .items(&parms.choices) |
| 44 | .interact() | 46 | .interact() |
| 45 | .context("failed to get choice") | 47 | .context("failed to get choice") |
| @@ -96,13 +98,20 @@ impl PromptConfirmParms { | |||
| 96 | pub struct PromptChoiceParms { | 98 | pub struct PromptChoiceParms { |
| 97 | pub prompt: String, | 99 | pub prompt: String, |
| 98 | pub choices: Vec<String>, | 100 | pub choices: Vec<String>, |
| 101 | pub report: bool, | ||
| 99 | } | 102 | } |
| 100 | 103 | ||
| 101 | impl PromptChoiceParms { | 104 | impl PromptChoiceParms { |
| 102 | pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self { | 105 | pub fn with_prompt<S: Into<String>>(mut self, prompt: S) -> Self { |
| 103 | self.prompt = prompt.into(); | 106 | self.prompt = prompt.into(); |
| 107 | self.report = true; | ||
| 104 | self | 108 | self |
| 105 | } | 109 | } |
| 110 | |||
| 111 | // pub fn dont_report(mut self) -> Self { | ||
| 112 | // self.report = false; | ||
| 113 | // self | ||
| 114 | // } | ||
| 106 | pub fn with_choices(mut self, choices: Vec<String>) -> Self { | 115 | pub fn with_choices(mut self, choices: Vec<String>) -> Self { |
| 107 | self.choices = choices; | 116 | self.choices = choices; |
| 108 | self | 117 | self |