adapters/shell
import "go-cli-template/internal/adapters/shell"Index
func DetectShell
func DetectShell() stringDetectShell attempts to detect the current shell from environment variables. Returns the detected shell type or “bash” as a fallback.
func GetFileExtension
func GetFileExtension(shellType string) stringGetFileExtension returns the appropriate file extension for the shell.
type Adapter
Adapter handles shell-specific syntax for aliases and functions.
type Adapter struct { // contains filtered or unexported fields}func New
func New(shellType string) *AdapterNew creates a new shell adapter for the given shell type.
func (*Adapter) FormatAlias
func (a *Adapter) FormatAlias(alias, command string) stringFormatAlias formats a bookmark alias for the configured shell.
Source
See internal/adapters/shell/ for implementation details.