interact

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIssue added in v0.7.0

func CreateIssue(login *config.Login, owner, repo string) error

CreateIssue interactively creates an issue

func CreateLogin

func CreateLogin() error

CreateLogin create an login interactive

func CreateMilestone added in v0.7.0

func CreateMilestone(login *config.Login, owner, repo string) error

CreateMilestone interactively creates a milestone

func CreatePull

func CreatePull(ctx *context.TeaContext) (err error)

CreatePull interactively creates a PR

func DoDiffReview added in v0.7.0

func DoDiffReview(ctx *context.TeaContext, idx int64) ([]gitea.CreatePullReviewComment, error)

DoDiffReview (1) fetches & saves diff in tempfile, (2) starts $VISUAL or $EDITOR to comment on diff, (3) parses resulting file into code comments. It doesn't really make sense to use survey.Editor() here, as we'd read the file content at least twice.

func IsStdinPiped added in v0.7.0

func IsStdinPiped() bool

IsStdinPiped checks if stdin is piped

func NewMultiline added in v0.9.0

func NewMultiline(opts Multiline) (prompt survey.Prompt)

NewMultiline creates a prompt that switches between the inline multiline text and a texteditor based prompt

func PromptPassword

func PromptPassword(name string) (pass string, err error)

PromptPassword asks for a password and blocks until input was made.

func ReviewPull added in v0.7.0

func ReviewPull(ctx *context.TeaContext, idx int64) error

ReviewPull interactively reviews a PR

func ShowCommentsMaybeInteractive added in v0.7.0

func ShowCommentsMaybeInteractive(ctx *context.TeaContext, idx int64, totalComments int) error

ShowCommentsMaybeInteractive fetches & prints comments, depending on the --comments flag. If that flag is unset, and output is not piped, prompts the user first.

func ShowCommentsPaginated added in v0.7.0

func ShowCommentsPaginated(ctx *context.TeaContext, idx int64, totalComments int) error

ShowCommentsPaginated prompts if issue/pr comments should be shown and continues to do so.

Types

type Multiline added in v0.9.0

type Multiline struct {
	Message   string
	Default   string
	Syntax    string
	UseEditor bool
}

Multiline represents options for a prompt that expects multiline input

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL