sheesh

package
v0.0.0-...-7c8dd5d Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg quicli.Config)

Generate: generate output of a sheesh command

func MarshallCommandContent

func MarshallCommandContent(c Command) (out string)

func MarshallCompletion

func MarshallCompletion(c Command) (out string)

func MarshallFlagCase

func MarshallFlagCase(f Flag) (out string)

func MarshallFlagCases

func MarshallFlagCases(flags []Flag) (out string)

func MarshallFlagDefinitions

func MarshallFlagDefinitions(flags []Flag) (out string)

func MarshallFlagInitVar

func MarshallFlagInitVar(f Flag) (out string)

func MarshallOutput

func MarshallOutput(cmdName, cmdContent, cmdCompletion string) (out string)

MarshallOutput: take command and construct shell output accordingly

func ProcessCommand

func ProcessCommand(c Command) (out string)

ProcessCommand: take the command and return all the sheesh output (function + completion)

func SetCommand

func SetCommand(cfg quicli.Config)

SetCommand: create a sheesh command (add it to others if they exist)

func SetFlag

func SetFlag(cfg quicli.Config)

SetFlag: add a flag of a sheesh command

func SetScript

func SetScript(cfg quicli.Config)

SetScript: set the script of of a sheesh command

Types

type Command

type Command struct {
	Name   string `yaml:"name"`
	Flags  []Flag `yaml:"flags"`
	Script string `yaml:"script"`
}

type CommandContent

type CommandContent struct {
	CommandName      string
	FlagInitVars     string
	FlagContentCases string
	Script           string
}

type Completion

type Completion struct {
	CommandName      string
	FlagsDefinitions string
	FlagCases        string
}

type Config

type Config struct {
	Commands []Command `yaml:"commands"`
}

type Flag

type Flag struct {
	Name        string   `yaml:"name"`
	Description string   `yaml:"description"`
	NoArgs      bool     `yaml:"noarg"`
	File        bool     `yaml:"file"`
	Predefined  []string `yaml:"predefined"`
}

type FlagCase

type FlagCase struct {
	FlagName string
	CaseDef  string
}

type FlagCaseCommand

type FlagCaseCommand struct {
	FlagName string
	VarName  string
	VarValue string
	Hyphen   string
	Shift    string
}

type FlagInit

type FlagInit struct {
	VarName      string
	DefaultValue string
}

type Output

type Output struct {
	CommandName       string
	Command           string
	CommandCompletion string
}

Jump to

Keyboard shortcuts

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