cli

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(o []byte) ([]byte, string, error)

Run will launch a editor to use a system defined editor such as vim to edit configs in place. It saves that content to a temp file for use as well as returning the raw bytes from the edit. It can optionally take an original bytes of content which can be used to compare if any edits were made.

Types

type Editor

type Editor struct {
	// Various arguments required to launch $EDITOR
	Args []string
}

func NewEditor

func NewEditor(args []string) (*Editor, error)

func (*Editor) LaunchEditor

func (e *Editor) LaunchEditor(filePath string) error

func (*Editor) LaunchWithTmp

func (e *Editor) LaunchWithTmp(prefix, suffix string, original []byte, r io.Reader) ([]byte, string, error)

Jump to

Keyboard shortcuts

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