summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-16 09:53:50 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-16 09:53:50 -0800
commit920a30b1ee400da06530e39997c6545c260736fe (patch)
tree87dcf45880122874b071c3fbbe33314749977cd6
parentf1fa430c6a9c97fa36a9599746eca0f9a474073b (diff)
update readme and usage, debug print fmt
-rw-r--r--README.md21
-rw-r--r--cmd/ponzu/main.go1
-rw-r--r--cmd/ponzu/usage.go11
3 files changed, 12 insertions, 21 deletions
diff --git a/README.md b/README.md
index 3df2090..0c91bc0 100644
--- a/README.md
+++ b/README.md
@@ -80,22 +80,17 @@ Errors will be reported, but successful commands return nothing.
### generate, gen, g
-Generate a content type file with boilerplate code to implement
-the editor.Editable interface. Must be given one (1) parameter of
-the name of the type for the new content. The fields following a
-type determine the field names and types of the content struct to
-be generated. These must be in the following format:
-fieldName:"T"
+Generate boilerplate code for various Ponzu components, such as `content`.
Example:
```bash
- struct fields and built-in types...
- |
- v
-$ ponzu gen review title:"string" body:"string" rating:"int" tags:"[]string"
- ^
- |
- struct type
+ generator struct fields and built-in types...
+ | |
+ v v
+$ ponzu gen content review title:"string" body:"string" rating:"int" tags:"[]string"
+ ^
+ |
+ struct type
```
The command above will generate the file `content/review.go` with boilerplate
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go
index b07a249..d2ec4d8 100644
--- a/cmd/ponzu/main.go
+++ b/cmd/ponzu/main.go
@@ -99,6 +99,7 @@ func main() {
// check what we are asked to generate
switch args[2] {
case "content", "c":
+ fmt.Println(args, "|", args[2])
err := generateContentType(args[2:])
if err != nil {
fmt.Println(err)
diff --git a/cmd/ponzu/usage.go b/cmd/ponzu/usage.go
index ee69cf4..2d7a3b8 100644
--- a/cmd/ponzu/usage.go
+++ b/cmd/ponzu/usage.go
@@ -54,17 +54,12 @@ new <directory>:
`
var usageGenerate = `
-generate, gen, g <type (,...fields)>:
+generate, gen, g <generator type (,...fields)>:
- Generate a content type file with boilerplate code to implement
- the editor.Editable interface. Must be given one (1) parameter of
- the name of the type for the new content. The fields following a
- type determine the field names and types of the content struct to
- be generated. These must be in the following format:
- fieldName:"T"
+ Generate boilerplate code for various Ponzu components, such as 'content'.
Example:
- $ ponzu gen review title:"string" body:"string" rating:"int" tags:"[]string"
+ $ ponzu gen content review title:"string" body:"string" rating:"int" tags:"[]string"
The command above will generate a file 'content/review.go' with boilerplate
methods, as well as struct definition, and cooresponding field tags like: