scripts

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ERR_ESTRPIPE = 86

error codes from https://adminschoice.com/exit-error-codes-in-bash-and-linux-os/

View Source
const KeywordLong = "extra"
View Source
const KeywordShort = "short"
View Source
const KeywordUse = "clog"

Variables

This section is empty.

Functions

func AddScript

func AddScript(cmd *cobra.Command, filePath string) error

Add a script from a given filename

func AwaitShellSnippet

func AwaitShellSnippet(snippet string, env map[string]string, cliArgs []string) (int, error)

Execute a shell snippet and stream the result, stdError & return status

func CaptureShellSnippet

func CaptureShellSnippet(snippet string, env map[string]string) (string, int, error)

Execute a shell snippet and get the result, return code and sys error

func Exec

func Exec(command string, args []string, env map[string]string) (int, error)

execute a command and restream Stdin & StdOut - return status

func FindScripts

func FindScripts(rootCmd *cobra.Command, folderGlob string)

Add scripts from clogrc folder

func GetShellPath

func GetShellPath() string

GitCmd represents the base core

Types

type ScriptInfo

type ScriptInfo struct {
	CmdUse    string
	CmdShort  string
	CmdLong   string
	NeedsOpts bool
	FilePath  string
}

func ParseScriptInfo

func ParseScriptInfo(filePath string) (*ScriptInfo, error)

scan a script file and create a map of the data found First 3 lines should be of the format:

	    #  clog> command [opts]    # optional short help
	    # short> a short help explanation\
      #        that can be multi-line using backslashes
	    # extra> long help printed when --help is used

type ScriptMap

type ScriptMap map[string]ScriptInfo

Jump to

Keyboard shortcuts

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