Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Source = &cli.Command{ Name: "source", Usage: "Commands for working with sources", Description: "Commands for working with sources, short-hand flags for easier downloads", Action: SourceList.Action, Subcommands: []*cli.Command{ SourceList, SourceAdd, SourceRemove, }, } SourceList = &cli.Command{ Name: "list", Usage: "List available sources", Description: "List all available sources in the registry", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "json", Usage: "JSON format", }, }, Action: runSourceList, } SourceAdd = &cli.Command{ Name: "add", Usage: "Add a source", Description: "Add a new source to the registry", ArgsUsage: "[base URL] [name]", Action: runSourceAdd, } SourceRemove = &cli.Command{ Name: "remove", Usage: "Remove a source", Description: "Remove a source from the registry", ArgsUsage: "[name]", Action: runSourceRemove, } )
View Source
var Download = &cli.Command{ Name: "download", Usage: "Download a template", Description: "Download a template and save it to the local registry", ArgsUsage: "[repository URL] <name>", Flags: []cli.Flag{ &cli.StringFlag{ Name: "branch", Aliases: []string{"b"}, Usage: "Branch to clone", Value: "main", EnvVars: []string{"TMPL_BRANCH"}, }, }, Action: runDownload, }
View Source
var Env = &cli.Command{ Name: "env", Usage: "Show tmpl environment variables", Description: "Show tmpl environment variables and their configuration", Action: runEnv, Subcommands: []*cli.Command{ { Name: "set", Aliases: []string{"add"}, Usage: "Set a tmpl environment variable (stored plaintext)", Description: "Set an environment variable that will be loaded specifically when running tmpl (stored plaintext)", ArgsUsage: "[key] [value]", Action: runEnvSet, }, { Name: "unset", Aliases: []string{"delete"}, Usage: "Unsets a tmpl environment variable", Description: "Unsets an environment variable previously set for tmpl", ArgsUsage: "[key]", Action: runEnvUnset, }, }, }
View Source
var Init = &cli.Command{
Name: "init",
Usage: "Initialize a template",
Description: "Initializes a template structure for creating a new tmpl template",
Action: runInit,
}
View Source
var List = &cli.Command{
Name: "list",
Usage: "List templates in the registry",
Description: "List all usable templates currently downloaded in the registry",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "json",
Usage: "JSON format",
},
},
Action: runList,
}
View Source
var Remove = &cli.Command{
Name: "remove",
Usage: "Remove a template",
Description: "Remove a template from the registry",
ArgsUsage: "[name]",
Action: runRemove,
}
View Source
var Restore = &cli.Command{
Name: "restore",
Usage: "Restore missing templates",
Description: "Restore templates that are listed in the registry, but are missing archives",
Action: runRestore,
}
View Source
var Save = &cli.Command{
Name: "save",
Usage: "Save a local template",
Description: "Save a local template to the registry",
ArgsUsage: "[path] [name]",
Action: runSave,
}
View Source
var Test = &cli.Command{
Name: "test",
Usage: "Test if a directory is a valid template",
Description: "Test whether a directory is valid for use with tmpl",
ArgsUsage: "[path (default: \".\")]",
Action: runTest,
}
View Source
var Update = &cli.Command{
Name: "update",
Usage: "Update a template",
Description: "Update a template in the registry from the original source",
ArgsUsage: "[name]",
Action: runUpdate,
}
View Source
var Use = &cli.Command{
Name: "use",
Usage: "Use a template",
Description: "Use (execute) a template from the registry",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "defaults",
Usage: "Use template defaults",
},
&cli.BoolFlag{
Name: "force",
Usage: "Overwrite existing files",
},
},
ArgsUsage: "[name] [destination (default: \".\")]",
Action: runUse,
}
View Source
var (
Version = "develop"
)
Functions ¶
func NewApp ¶
func NewApp() *cli.App
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.