From e146bf9ba5d8d0a95d90ad389f95f7d7c1ff738a Mon Sep 17 00:00:00 2001 From: Jeremy Saenz Date: Sat, 20 Jul 2013 15:58:51 -0700 Subject: [PATCH] Added subcommands to the readme --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 416e99f..eb3af99 100644 --- a/README.md +++ b/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)