shell

package
v1.33.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ForceShell forces a shell name
	ForceShell string
)

Functions

func Detect

func Detect() (string, error)

Detect detects user's current shell.

func SetScript

func SetScript(w io.Writer, envTmpl string, data interface{}) error

SetScript writes out a shell-compatible set script

func UnsetScript

func UnsetScript(ec EnvConfig, w io.Writer, vars []string) error

UnsetScript writes out a shell-compatible unset script

Types

type Config

type Config struct {
	Prefix    string
	Delimiter string
	Suffix    string
	UsageHint string
}

Config represents the shell config

func CfgSet

func CfgSet(ec EnvConfig, plz, cmd string) *Config

CfgSet generates context variables for shell

type EnvConfig

type EnvConfig struct {
	Shell string
}

EnvConfig encapsulates all external inputs into shell generation

Jump to

Keyboard shortcuts

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