mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-02 18:08:30 +02:00
Add git helper (#612)
Add support to tea login with helper same another tools and `gh` Reviewed-on: https://gitea.com/gitea/tea/pulls/612 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com> Co-committed-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
This commit is contained in:

committed by
6543

parent
a35bf931ae
commit
2984ad4964
@ -127,6 +127,24 @@ func promptMultiSelect(prompt string, options []string, customVal string) ([]str
|
||||
return promptCustomVal(prompt, customVal, selection)
|
||||
}
|
||||
|
||||
// promptSelectV2 creates a generic select prompt
|
||||
func promptSelectV2(prompt string, options []string) (string, error) {
|
||||
if len(options) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
var selection string
|
||||
promptA := &survey.Select{
|
||||
Message: prompt,
|
||||
Options: options,
|
||||
VimMode: true,
|
||||
Default: options[0],
|
||||
}
|
||||
if err := survey.AskOne(promptA, &selection); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return selection, nil
|
||||
}
|
||||
|
||||
// promptSelect creates a generic select prompt, with processing of custom values or none-option.
|
||||
func promptSelect(prompt string, options []string, customVal, noneVal string) (string, error) {
|
||||
var selection string
|
||||
|
Reference in New Issue
Block a user