command_plus

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandEntry

type CommandEntry struct {
	CommandEntryFunc `json:"-"`
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(cliName string, opts ...CommandEntryOption) (opt *CommandEntry)

NewCmd

use as

changeCommandEntry := NewCmd(
    WithRunPath(""),
)

func (*CommandEntry) Exec

func (c *CommandEntry) Exec() error

func (*CommandEntry) ExecCode

func (c *CommandEntry) ExecCode() int

func (*CommandEntry) ExecStdErr

func (c *CommandEntry) ExecStdErr() string

func (*CommandEntry) ExecStdOut

func (c *CommandEntry) ExecStdOut() string

func (*CommandEntry) IsCliAvailable

func (c *CommandEntry) IsCliAvailable() bool

type CommandEntryFunc

type CommandEntryFunc interface {
	IsCliAvailable() bool

	Exec() error

	ExecCode() int

	ExecStdOut() string

	ExecStdErr() string
}

type CommandEntryOption

type CommandEntryOption func(*CommandEntry)

func WithCommandArgs

func WithCommandArgs(commandArgs []string) CommandEntryOption

func WithRunPath

func WithRunPath(runPath string) CommandEntryOption

Jump to

Keyboard shortcuts

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