surveyext

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

this is a wrapper for https://github.com/AlecAivazis/survey package but with additional extensions and customizations for glab adapted from https://github.com/cli/cli/blob/trunk/pkg/surveyext/editor.go

Index

Constants

This section is empty.

Variables

View Source
var EditorQuestionTemplate = `` /* 728-byte string literal not displayed */

EXTENDED to change prompt text

Functions

func Edit

func Edit(editorCommand, fn, initialValue string, stdin io.Reader, stdout io.Writer, stderr io.Writer, cursor showable) (string, error)

Types

type EditorTemplateData

type EditorTemplateData struct {
	survey.Editor
	EditorCommand string
	BlankAllowed  bool
	Answer        string
	ShowAnswer    bool
	ShowHelp      bool
	Config        *survey.PromptConfig
}

EXTENDED to pass editor name (to use in prompt)

type GLabEditor

type GLabEditor struct {
	*survey.Editor
	EditorCommand string
	BlankAllowed  bool
}

EXTENDED to enable different prompting behavior

func (*GLabEditor) Prompt

func (e *GLabEditor) Prompt(config *survey.PromptConfig) (interface{}, error)

EXTENDED This is straight copypasta from survey to get our overridden prompt called.;

Jump to

Keyboard shortcuts

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