Minor changes
This commit is contained in:
parent
7050f048d1
commit
fbbda7a902
22
README.md
22
README.md
@ -30,8 +30,10 @@ One of the philosophies behind cli.go is that an API should be playful and full
|
|||||||
``` go
|
``` go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
import "github.com/codegangsta/cli"
|
"os"
|
||||||
|
"github.com/codegangsta/cli"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cli.NewApp().Run(os.Args)
|
cli.NewApp().Run(os.Args)
|
||||||
@ -43,8 +45,10 @@ This app will run and show help text, but is not very useful. Let's give an acti
|
|||||||
``` go
|
``` go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
import "github.com/codegangsta/cli"
|
"os"
|
||||||
|
"github.com/codegangsta/cli"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
@ -68,8 +72,10 @@ Being a programmer can be a lonely job. Thankfully by the power of automation th
|
|||||||
/* greet.go */
|
/* greet.go */
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
import "github.com/codegangsta/cli"
|
"os"
|
||||||
|
"github.com/codegangsta/cli"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
@ -158,7 +164,7 @@ app.Commands = []cli.Command{
|
|||||||
ShortName: "a",
|
ShortName: "a",
|
||||||
Usage: "add a task to the list",
|
Usage: "add a task to the list",
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
println("added task: ", c.Args()[0])
|
println("added task: ", c.FirstArg())
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -166,7 +172,7 @@ app.Commands = []cli.Command{
|
|||||||
ShortName: "c",
|
ShortName: "c",
|
||||||
Usage: "complete a task on the list",
|
Usage: "complete a task on the list",
|
||||||
Action: func(c *cli.Context) {
|
Action: func(c *cli.Context) {
|
||||||
println("completed task: ", c.Args()[0])
|
println("completed task: ", c.FirstArg())
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user