mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
refactor: remove helpers the new output and prompts left unused
Drop writeDownload, terminal.Require, terminal.Confirm, terminal.Row, terminal.Record and Pulls.FindOpenByHead, which no command calls anymore, and point their tests at the code that replaced them. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
8 files changed
+34
-118
No files matched your search
@@ -205,11 +205,6 @@ func RequireInput(ctx context.Context, value *string, flag, label string, valida
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Require is RequireInput titled by the flag name, for callers without a human label.
|
||||
func Require(ctx context.Context, value *string, flag string, streams Streams, policy Policy, prompt Prompter) (bool, error) {
|
||||
return RequireInput(ctx, value, flag, flag, nil, streams, policy, prompt)
|
||||
}
|
||||
|
||||
// Confirmation describes the question asked before an action.
|
||||
type Confirmation struct {
|
||||
// Prompt asks about the action in sentence case: `Delete label "bug" from alice/x?`.
|
||||
@@ -267,9 +262,3 @@ func ConfirmAction(ctx context.Context, c Confirmation, yes bool, streams Stream
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// Confirm requires explicit acceptance unless confirmation was supplied by flag.
|
||||
// It is ConfirmAction for callers that predate Confirmation.
|
||||
func Confirm(ctx context.Context, description string, yes bool, streams Streams, policy Policy, prompt Prompter) error {
|
||||
return ConfirmAction(ctx, Confirmation{Prompt: description}, yes, streams, policy, prompt)
|
||||
}
|
||||
Reference in new issue
Block a user