Documentation ¶
Index ¶
Constants ¶
View Source
const ( ApplyTemplateFlag = "template" ApplyNameFlag = "name" ApplyOutFlag = "out" ApplyVarFlag = "var" ApplyVarFileFlag = "var-file" )
View Source
const ( InterpolateTemplateFlag = "template" InterpolateNameFlag = "name" InterpolateVarFlag = "var" InterpolateVarFileFlag = "var-file" )
View Source
const (
InitializeTemplateFlag = "template"
)
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 [-t|--template <TEMPLATEDIR|TEMPLATEFILE>] [-n|--name <TEMPLATENAME>] [OUTDIR]", Action: ApplyAction, Flags: []cli.Flag{ &cli.StringFlag{ Name: ApplyTemplateFlag, Aliases: []string{"t"}, Value: ".caster.yml", }, &cli.StringFlag{ Name: ApplyNameFlag, Aliases: []string{"n"}, }, &cli.StringSliceFlag{ Name: ApplyVarFlag, }, &cli.StringSliceFlag{ Name: ApplyVarFileFlag, TakesFile: true, }, }, }
View Source
var Initialize = &cli.Command{ Name: "initialize", Aliases: []string{"init"}, Description: "initializes the speified directory or file with the default template", Usage: "initializes the speified directory or file with the default template", UsageText: "caster init [DIRECTORY|FIILE]", Action: InitializeAction, Flags: []cli.Flag{ &cli.StringFlag{ Name: InitializeTemplateFlag, Aliases: []string{"t"}, Value: ".", }, }, }
View Source
var Interpolate = &cli.Command{ Name: "interpolate", Aliases: []string{"inter"}, Description: "interpolates the specified template and outputs the result", Usage: "interpolates the specified template and outputs the result", UsageText: "caster interpolate [-t|--template <TEMPLATEDIR|TEMPLATEFILE>] [-n|--name <TEMPLATENAME>]", Action: InterpolateAction, Flags: []cli.Flag{ &cli.StringFlag{ Name: InterpolateTemplateFlag, Aliases: []string{"t"}, Value: ".", }, &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 InitializeAction ¶ added in v0.2.0
func InitializeAction(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 InitializeCommand ¶ added in v0.2.0
type InitializeCommand struct { Options InitializeOptions Service initialize.Service `inject:""` }
func (*InitializeCommand) Execute ¶ added in v0.2.0
func (cmd *InitializeCommand) Execute() error
type InitializeOptions ¶ added in v0.2.0
type InitializeOptions struct {
Template string
}
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
Click to show internal directories.
Click to hide internal directories.