Skip to content

Instantly share code, notes, and snippets.

@KAllan357
Created July 28, 2014 18:29
Show Gist options
  • Save KAllan357/f25cf02811b367d80ff1 to your computer and use it in GitHub Desktop.
Save KAllan357/f25cf02811b367d80ff1 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/codegangsta/cli"
"os"
)
func main() {
app := cli.NewApp()
app.Name = "test"
app.Usage = "test"
app.CommandNotFound = func(context *cli.Context, command string) {
fmt.Printf("command not found: %s", command)
}
app.Commands = []cli.Command{
Example,
}
app.Run(os.Args)
}
var Example = cli.Command{
Name: "example",
Usage: "example",
Description: "example",
Subcommands: []cli.Command{
exampleCMD,
},
}
var exampleCMD = cli.Command{
Name: "sub",
Usage: "sub",
Description: "sub",
Action: nil,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment