{"modulePath":"github.com/DomBlack/git-stack","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shell\n\nPackage shell composes the completion scripts git-stack installs: cobra's generated script for the git-stack binary plus the hooks that make \\`git stack \\\u003cTAB\u003e\\` and git aliases such as \\`git co \\\u003cTAB\u003e\\` complete through the same engine.\n\n## Variables\n\n```go\nvar All = []Shell{Bash, Zsh, Fish}\n```\nAll lists the supported shells.\n\n## Functions\n\n```go\nfunc Arg(s string) (quoted string, ok bool)\n```\nArg makes s safe to paste as one argument into bash, zsh or fish: as it is when nothing in it is special, otherwise in single quotes ('\\\\” for a quote, which all three read the same way). ok is false when s holds a control character: no quoting makes that safe to paste (a newline ends the command, a pasted tab can trigger completion), so callers should describe what to do rather than print a command.\n\n```go\nfunc Compose(sh Shell, cobraScript string) (string, error)\n```\nCompose returns the script to install for sh, given cobra's generated script for the git-stack binary.\n\n```go\nfunc Path(p string) (string, bool)\n```\nPath is Arg for a path, leaving a leading ~/ outside the quotes so the shell still expands it (~/'my app' works in all three).\n\n## Types\n\n```go\ntype Env struct {\n\tHome          string\n\tXDGConfigHome string\n\tXDGDataHome   string\n}\n```\nEnv is the subset of the environment path resolution needs.\n\n```go\nfunc (e Env) Hint(sh Shell) string\n```\nHint explains anything the user must do by hand after installing.\n\n```go\nfunc (e Env) InstallPath(sh Shell) string\n```\nInstallPath is where the composed script lives for sh.\n\n```go\ntype Shell string\n```\nShell is a supported shell.\n\n```go\nconst (\n\tBash Shell = \"bash\"\n\tZsh  Shell = \"zsh\"\n\tFish Shell = \"fish\"\n)\n```\n\n```go\nfunc Detect(shellEnv string) (Shell, bool)\n```\nDetect guesses the login shell from $SHELL.\n\n```go\nfunc Parse(name string) (Shell, error)\n```\nParse validates a shell name.\n\n","path":"github.com/DomBlack/git-stack/pkg/shell","name":"shell","synopsis":"Package shell composes the completion scripts git-stack installs: cobra's generated script for the git-stack binary plus the hooks that make `git stack \u003cTAB\u003e` and git aliases such as `git co \u003cTAB\u003e` complete through the same engine.","isRedistributable":true}
