Skip to content

Commit

Permalink
tools: Clarify purpose of gobot CLI being to generate new platforms, …
Browse files Browse the repository at this point in the history
…adaptors, and drivers

Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 8, 2016
1 parent 01ab0b4 commit f539684
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cli/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CLI tool for generating new Gobot projects.
NAME:
gobot - Command Line Utility for Gobot
gobot - Command Line Utility for generating new Gobot adaptors, drivers, and platforms
USAGE:
gobot [global options] command [command options] [arguments...]
Expand All @@ -11,7 +11,7 @@ CLI tool for generating new Gobot projects.
0.1
COMMANDS:
generate Generate new Gobot adaptors, drivers, and projects
generate Generate new Gobot adaptors, drivers, and platforms
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
Expand Down
12 changes: 6 additions & 6 deletions cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ type config struct {
func Generate() cli.Command {
return cli.Command{
Name: "generate",
Usage: "Generate new Gobot adaptors, drivers, and projects",
Usage: "Generate new Gobot adaptors, drivers, and platforms",
Action: func(c *cli.Context) {
valid := false
for _, s := range []string{"adaptor", "driver", "project"} {
for _, s := range []string{"adaptor", "driver", "platform"} {
if s == c.Args().First() {
valid = true
}
Expand All @@ -35,7 +35,7 @@ func Generate() cli.Command {
fmt.Println("Usage:")
fmt.Println(" gobot generate adaptor <name> [package] # generate a new Gobot adaptor")
fmt.Println(" gobot generate driver <name> [package] # generate a new Gobot driver")
fmt.Println(" gobot generate project <name> [package] # generate a new Gobot project")
fmt.Println(" gobot generate platform <name> [package] # generate a new Gobot platform")
return
}

Expand Down Expand Up @@ -68,7 +68,7 @@ func Generate() cli.Command {
if err := generateDriver(cfg); err != nil {
fmt.Println(err)
}
case "project":
case "platform":
pwd, err := os.Getwd()
if err != nil {
fmt.Println(err)
Expand All @@ -89,7 +89,7 @@ func Generate() cli.Command {
return
}

if err := generateProject(cfg); err != nil {
if err := generatePlatform(cfg); err != nil {
fmt.Println(err)
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func generateAdaptor(c config) error {
return generate(c, c.Name+"_adaptor_test.go", adaptorTest())
}

func generateProject(c config) error {
func generatePlatform(c config) error {
if err := generateDriver(c); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func main() {
app.Author = "The Gobot team"
app.Email = "https://github.com/hybridgroup/gobot"
app.Version = gobot.Version()
app.Usage = "Command Line Utility for Gobot"
app.Usage = "Command Line Utility for generating new Gobot adaptors, drivers, and platforms"
app.Commands = []cli.Command{
Generate(),
}
Expand Down

0 comments on commit f539684

Please sign in to comment.