cmd

package
Version: v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 11 Imported by: 0

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",
		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,
}
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",
	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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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