Created
July 28, 2014 18:29
-
-
Save KAllan357/f25cf02811b367d80ff1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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