Documentation
¶
Index ¶
- Constants
- Variables
- func AddAlias(alias string, command string) error
- func GetAliasCommand(alias string) (string, error)
- func GetAliasPath(alias string) string
- func GetShell() (string, error)
- func GetShellName() (string, error)
- func GetShellRcPath() (string, error)
- func IsMagicAliasInPath() (bool, error)
- func ListAliases() ([]string, error)
- func RemoveAlias(alias string) error
- func RemoveMagicAliasFromRc(rcPath string) error
- func RemoveScriptContent(content string) string
- func RenderScriptContent(shell string) (string, error)
- func WriteMagicAliasToRc(shell string) error
- func WriteMagicAliasToRcPath(shell, rcPath string) error
- type ScriptContentArgs
Constants ¶
View Source
const ScriptFinalLine = "# End of Magic Alias"
View Source
const ScriptFirstLine = "# Magic Alias (ma)"
Variables ¶
View Source
var MagicAliasPath string
Functions ¶
func GetAliasCommand ¶ added in v0.0.2
GetAliasCommand reads the alias file and extracts the command
func GetAliasPath ¶
GetAliasPath returns the full path to an alias file
func GetShellName ¶
func GetShellRcPath ¶
func IsMagicAliasInPath ¶
func ListAliases ¶
func RemoveAlias ¶
func RemoveMagicAliasFromRc ¶
RemoveMagicAliasFromRc removes the magic alias PATH export from the rc file
func RemoveScriptContent ¶
RemoveScriptContent removes all content between ScriptFirstLine and ScriptFinalLine (inclusive) from the provided string and returns the result
func RenderScriptContent ¶
func WriteMagicAliasToRc ¶
func WriteMagicAliasToRcPath ¶
Types ¶
type ScriptContentArgs ¶
Click to show internal directories.
Click to hide internal directories.