Added subcommands to the readme
This commit is contained in:
parent
e14e45d087
commit
e146bf9ba5
22
README.md
22
README.md
@ -143,8 +143,26 @@ app.Action = func(c *cli.Context) {
|
||||
### Subcommands
|
||||
|
||||
Subcommands can be defined for a more git-like command line app.
|
||||
WIP
|
||||
|
||||
```go
|
||||
app.Commands = []cli.Command{
|
||||
{
|
||||
Name: "add",
|
||||
ShortName: "a",
|
||||
Usage: "add a task to the list",
|
||||
Action: func(c *cli.Context) {
|
||||
println("added task: ", c.Args()[0])
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "complete",
|
||||
ShortName: "c",
|
||||
Usage: "complete a task on the list",
|
||||
Action: func(c *cli.Context) {
|
||||
println("completed task: ", c.Args()[0])
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
## About
|
||||
cli.go is written by none other than the [Code Gangsta](http://codegangsta.io)
|
||||
|
Loading…
Reference in New Issue
Block a user