shellenv

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DeclTypeArray      = "array"
	DeclTypeAssocArray = "assoc"
	DeclTypeInt        = "int"
	DeclTypeNormal     = "normal"
)

Variables

This section is empty.

Functions

func DeclMapFromState

func DeclMapFromState(state *packet.ShellState) map[string]*DeclareDeclType

func DeclsEqual

func DeclsEqual(compareName bool, d1 *DeclareDeclType, d2 *DeclareDeclType) bool

func DumpVarMapFromState

func DumpVarMapFromState(state *packet.ShellState)

func EnvMapFromState

func EnvMapFromState(state *packet.ShellState) map[string]string

func RemoveFunc

func RemoveFunc(funcs string, toRemove string) string

func SerializeDeclMap

func SerializeDeclMap(declMap map[string]*DeclareDeclType) []byte

func ShellStateVarsToMap

func ShellStateVarsToMap(shellVars []byte) map[string][]byte

func ShellVarMapFromState

func ShellVarMapFromState(state *packet.ShellState) map[string]string

func StrMapToShellStateVars

func StrMapToShellStateVars(varMap map[string][]byte) []byte

Types

type DeclareDeclType

type DeclareDeclType struct {
	IsZshDecl bool
	IsExtVar  bool // set for "special" wave internal variables

	Args string
	Name string

	// this holds the raw quoted value suitable for bash. this is *not* the real expanded variable value
	Value string

	// special fields for zsh "-T" output.
	// for bound scalars, "Value" hold everything after the "=" (including the separator character)
	ZshBoundScalar string // the name of the "scalar" env variable
	ZshEnvValue    string // unlike Value this *is* the expanded value of scalar env variable
}

func FindVarDecl

func FindVarDecl(decls []*DeclareDeclType, name string) *DeclareDeclType

func VarDeclsFromState

func VarDeclsFromState(state *packet.ShellState) []*DeclareDeclType

func (*DeclareDeclType) AddFlag

func (d *DeclareDeclType) AddFlag(flag string)

func (*DeclareDeclType) DataType

func (d *DeclareDeclType) DataType() string

func (*DeclareDeclType) IsArray

func (d *DeclareDeclType) IsArray() bool

func (*DeclareDeclType) IsAssocArray

func (d *DeclareDeclType) IsAssocArray() bool

func (*DeclareDeclType) IsExport

func (d *DeclareDeclType) IsExport() bool

func (*DeclareDeclType) IsReadOnly

func (d *DeclareDeclType) IsReadOnly() bool

func (*DeclareDeclType) IsUniqueArray

func (d *DeclareDeclType) IsUniqueArray() bool

func (*DeclareDeclType) IsZshScalarBound

func (d *DeclareDeclType) IsZshScalarBound() bool

func (*DeclareDeclType) Serialize

func (d *DeclareDeclType) Serialize() []byte

NOTE Serialize no longer writes the final null byte

func (*DeclareDeclType) SortZshFlags

func (d *DeclareDeclType) SortZshFlags()

func (*DeclareDeclType) UnescapedValue

func (d *DeclareDeclType) UnescapedValue() string

Jump to

Keyboard shortcuts

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