Skip to content
Snippets Groups Projects
Commit 0011865e authored by Tamer Tas's avatar Tamer Tas
Browse files

Improve cmd-line command short descriptions

parent 7c4d1d9d
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ import ( ...@@ -15,7 +15,7 @@ import (
var Delete = &cli.Command{ var Delete = &cli.Command{
Use: "delete <template-name>", Use: "delete <template-name>",
Short: "Deletes a project template from the template registry", Short: "Delete a project template from the template registry",
Run: func(c *cli.Command, args []string) { Run: func(c *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{ MustValidateArgs(args, []validate.Argument{
{"template-path", validate.Alphanumeric}, {"template-path", validate.Alphanumeric},
......
...@@ -94,7 +94,7 @@ func downloadZip(URL, targetDir string) error { ...@@ -94,7 +94,7 @@ func downloadZip(URL, targetDir string) error {
// FIXME Half-Updates leave messy templates // FIXME Half-Updates leave messy templates
var Download = &cli.Command{ var Download = &cli.Command{
Use: "download <template-repo> <template-name>", Use: "download <template-repo> <template-name>",
Short: "Downloads a project template from an URL to template registry", Short: "Download a project template from a github repository to template registry",
Run: func(c *cli.Command, args []string) { Run: func(c *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{ MustValidateArgs(args, []validate.Argument{
{"template-repo", validate.UnixPath}, {"template-repo", validate.UnixPath},
......
...@@ -17,7 +17,7 @@ var ( ...@@ -17,7 +17,7 @@ var (
// TODO remove? // TODO remove?
var Init = &cli.Command{ var Init = &cli.Command{
Use: "init", Use: "init",
Short: "Initializes directories required by tmplt", Short: "Initialize directories required by tmplt (By default done by installation script)",
Run: func(c *cli.Command, _ []string) { Run: func(c *cli.Command, _ []string) {
// Check if .config/tmplt exists // Check if .config/tmplt exists
if exists, err := osutil.DirExists(tmplt.Configuration.TemplateDirPath); exists { if exists, err := osutil.DirExists(tmplt.Configuration.TemplateDirPath); exists {
......
...@@ -34,7 +34,7 @@ func ListTemplates() (map[string]bool, error) { ...@@ -34,7 +34,7 @@ func ListTemplates() (map[string]bool, error) {
var List = &cli.Command{ var List = &cli.Command{
Use: "list <template-path> <template-name>", Use: "list <template-path> <template-name>",
Short: "Lists templates found in the template registry", Short: "List project templates found in the local template registry",
Run: func(c *cli.Command, args []string) { Run: func(c *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{}) MustValidateArgs(args, []validate.Argument{})
......
...@@ -15,7 +15,7 @@ import ( ...@@ -15,7 +15,7 @@ import (
var Save = &cli.Command{ var Save = &cli.Command{
Use: "save <template-path> <template-name>", Use: "save <template-path> <template-name>",
Short: "Saves a project template to template registry", Short: "Save a project template to local template registry",
Run: func(c *cli.Command, args []string) { Run: func(c *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{ MustValidateArgs(args, []validate.Argument{
{"template-path", validate.UnixPath}, {"template-path", validate.UnixPath},
......
...@@ -26,7 +26,7 @@ func TemplateInRegistry(name string) (bool, error) { ...@@ -26,7 +26,7 @@ func TemplateInRegistry(name string) (bool, error) {
// TODO add --use-cache flag to execute a template from previous answers to prompts // TODO add --use-cache flag to execute a template from previous answers to prompts
var Use = &cli.Command{ var Use = &cli.Command{
Use: "use <template-name> <target-dir>", Use: "use <template-name> <target-dir>",
Short: "Executes a project template", Short: "Execute a project template in the given directory",
Run: func(_ *cli.Command, args []string) { Run: func(_ *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{ MustValidateArgs(args, []validate.Argument{
{"template-name", validate.UnixPath}, {"template-name", validate.UnixPath},
......
...@@ -6,12 +6,15 @@ import ( ...@@ -6,12 +6,15 @@ import (
cli "github.com/spf13/cobra" cli "github.com/spf13/cobra"
"github.com/tmrts/tmplt/pkg/tmplt" "github.com/tmrts/tmplt/pkg/tmplt"
"github.com/tmrts/tmplt/pkg/util/validate"
) )
var Version = &cli.Command{ var Version = &cli.Command{
Use: "version", Use: "version",
Short: "Version information for tmplt", Short: "Show the tmplt version information",
Run: func(_ *cli.Command, args []string) { Run: func(_ *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{})
fmt.Println("Current version is", tmplt.Version) fmt.Println("Current version is", tmplt.Version)
}, },
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment