summaryrefslogtreecommitdiff
path: root/cmd/ponzu/new.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-05-22 01:56:17 -0700
committerSteve Manuel <nilslice@gmail.com>2017-05-22 01:56:17 -0700
commitba0166f681e054afd6a3c9192ea1c68e6d7bc6a5 (patch)
treebcdc5c2514b63709edf442d9c21efc59d151edea /cmd/ponzu/new.go
parent4854ce1d4e3adca3b416a564a8d0018448808e52 (diff)
updating usage notes and multi-word formatted flags
Diffstat (limited to 'cmd/ponzu/new.go')
-rw-r--r--cmd/ponzu/new.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/cmd/ponzu/new.go b/cmd/ponzu/new.go
index 9911931..2f16a53 100644
--- a/cmd/ponzu/new.go
+++ b/cmd/ponzu/new.go
@@ -11,22 +11,24 @@ import (
)
var newCmd = &cobra.Command{
- Use: "new [projectName]",
- Short: "creates a 'ponzu' directory or the name supplied as a parameter",
- Long: `Creates a 'ponzu' directory or one by the name supplied as a parameter
+ Use: "new [flags] <project name>",
+ Short: "creates a project directory of the name supplied as a parameter",
+ Long: `Creates aproject directory of the name supplied as a parameter
immediately following the 'new' option in the $GOPATH/src directory. Note:
'new' depends on the program 'git' and possibly a network connection. If
there is no local repository to clone from at the local machine's $GOPATH,
'new' will attempt to clone the 'github.com/ponzu-cms/ponzu' package from
-over the network.
-
-Errors will be reported, but successful commands return nothing.`,
- Example: `$ ponzu new myProject
-> New ponzu project created at $GOPATH/src/myProject`,
+over the network.`,
+ Example: `$ ponzu new github.com/nilslice/proj
+> New ponzu project created at $GOPATH/src/github.com/nilslice/proj`,
RunE: func(cmd *cobra.Command, args []string) error {
projectName := "ponzu"
if len(args) > 0 {
projectName = args[0]
+ } else {
+ msg := "Please provide a project name."
+ msg += "\nThis will create a directory within your $GOPATH/src."
+ return fmt.Errorf("%s", msg)
}
return newProjectInDir(projectName)
},