Documentation
¶
Index ¶
Constants ¶
const ( ACK = 6 TAB = 9 LF = 10 CR = 13 US = 31 SPACE = 32 AMPERSTAND = 38 SINGLE_QUOTE = 39 PLUS = 43 NINE = 57 QUESTION = 63 UPPERCASE_Z = 90 OPEN_BRACKET = 91 BACKSLASH = 92 UNDERSCORE = 95 CLOSE_BRACKET = 93 BACKTICK = 96 LOWERCASE_Z = 122 TILDA = 126 DEL = 127 )
nolint
Variables ¶
This section is empty.
Functions ¶
func BashEscape ¶
https://github.com/solidsnack/shell-escape/blob/master/Text/ShellEscape/Bash.hs
A Bash escaped string. The strings are wrapped in @$\'...\'@ if any bytes within them must be escaped; otherwise, they are left as is. Newlines and other control characters are represented as ANSI escape sequences. High bytes are represented as hex codes. Thus Bash escaped strings will always fit on one line and never contain non-ASCII bytes.
Types ¶
type Shell ¶
type Shell interface {
// Hook is the string that gets evaluated into the host shell config and
// setups direnv as a prompt hook.
Hook() (string, error)
// Export outputs the ShellExport as an evaluatable string on the host shell
Export(e ShellExport) string
// Dump outputs and evaluatable string that sets the env in the host shell
Dump(env Env) string
}
Shell is the interface that represents the interaction with the host shell.
var Bash Shell = bash{}
Bash shell instance
var Fish Shell = fish{}
Fish adds support for the fish shell as a host
var Ksh Shell = ksh{}
Ksh adds support the korn shell
var Posix Shell = posix{}
Posix adds support for posix-compatible shells Specifically, in the context of devbox, this includes `dash`, `ash`, and `shell`
var UnknownSh Shell = unknown{}
UnknownSh adds support the unknown shell. This serves as a fallback alternative to outright failure.
var Zsh Shell = zsh{}
Zsh adds support for the venerable Z shell.
func DetectShell ¶
DetectShell returns a Shell instance from the given shell name TODO: use a single common "enum" for both shenv and DevboxShell
type ShellExport ¶
ShellExport represents environment variables to add and remove on the host shell.
func (ShellExport) Add ¶
func (e ShellExport) Add(key, value string)
Add represents the addition of a new environment variable
func (ShellExport) Remove ¶
func (e ShellExport) Remove(key string)
Remove represents the removal of a given `key` environment variable.