commands

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplyFileFlag      = "apply"
	ApplyDirectoryFlag = "directory"
	ApplyNameFlag      = "name"
	ApplyVarFlag       = "var"
	ApplyVarFileFlag   = "var-file"
)
View Source
const (
	InterpolateFileFlag      = "interpolate"
	InterpolateDirectoryFlag = "directory"
	InterpolateNameFlag      = "name"
	InterpolateVarFlag       = "var"
	InterpolateVarFileFlag   = "var-file"
)

Variables

View Source
var Apply = &cli.Command{
	Name:        "apply",
	Description: "applies the specified template to the target directory",
	Usage:       "Applies the specified template to the target directory",
	UsageText:   "caster apply (-f <TEMPLATE_FILE> | -d <TEMPLATE_DIRECTORY | -n <NAME>) [<TARGET>]",
	Action:      ApplyAction,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    ApplyFileFlag,
			Aliases: []string{"f"},
		},
		&cli.StringFlag{
			Name:    ApplyDirectoryFlag,
			Aliases: []string{"d"},
		},
		&cli.StringFlag{
			Name:    ApplyNameFlag,
			Aliases: []string{"n"},
		},
		&cli.StringSliceFlag{
			Name: ApplyVarFlag,
		},
		&cli.StringSliceFlag{
			Name:      ApplyVarFileFlag,
			TakesFile: true,
		},
	},
}
View Source
var Interpolate = &cli.Command{
	Name:        "interpolate",
	Description: "interpolates the specified template and outputs the result",
	Usage:       "interpolates the specified template and outputs the result",
	UsageText:   "caster interpolate (-f <TEMPLATE_FILE> | -d <TEMPLATE_DIRECTORY | -n <NAME>) [<TARGET>]",
	Action:      InterpolateAction,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    InterpolateFileFlag,
			Aliases: []string{"f"},
		},
		&cli.StringFlag{
			Name:    InterpolateDirectoryFlag,
			Aliases: []string{"d"},
		},
		&cli.StringFlag{
			Name:    InterpolateNameFlag,
			Aliases: []string{"n"},
		},
		&cli.StringSliceFlag{
			Name: InterpolateVarFlag,
		},
		&cli.StringSliceFlag{
			Name:      InterpolateVarFileFlag,
			TakesFile: true,
		},
	},
}

Functions

func ApplyAction

func ApplyAction(ctx *cli.Context) error

func InterpolateAction

func InterpolateAction(ctx *cli.Context) error

Types

type ApplyCommand

type ApplyCommand struct {
	Options     ApplyOptions
	Environment env.Environment `inject:""`
	Service     cast.Service    `inject:""`
}

func (*ApplyCommand) Execute

func (cmd *ApplyCommand) Execute() error

type ApplyOptions

type ApplyOptions struct {
	Directory string
	File      string
	Name      string
	Target    string
	Variables []models.Variable
}

type InterpolateCommand

type InterpolateCommand struct {
	Options     InterpolateOptions
	Environment env.Environment     `inject:""`
	Service     interpolate.Service `inject:""`
	Console     console.Console     `inject:""`
}

func (*InterpolateCommand) Execute

func (cmd *InterpolateCommand) Execute() error

type InterpolateOptions

type InterpolateOptions struct {
	Directory string
	File      string
	Name      string
	Variables []models.Variable
}

Jump to

Keyboard shortcuts

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