2013-12-03 06:50:02 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/gonuts/commander"
|
|
|
|
"github.com/gonuts/flag"
|
2014-04-02 10:20:38 +08:00
|
|
|
"os"
|
2013-12-03 06:50:02 +08:00
|
|
|
)
|
|
|
|
|
2013-12-19 21:19:22 +08:00
|
|
|
var g_cmd *commander.Command
|
2013-12-03 06:50:02 +08:00
|
|
|
|
|
|
|
func init() {
|
2013-12-19 21:19:22 +08:00
|
|
|
g_cmd = &commander.Command{
|
|
|
|
UsageLine: "gobot <command>",
|
|
|
|
Subcommands: []*commander.Command{
|
2013-12-03 06:50:02 +08:00
|
|
|
generate(),
|
|
|
|
},
|
2013-12-19 21:19:22 +08:00
|
|
|
Flag: *flag.NewFlagSet("gobot", flag.ExitOnError),
|
2013-12-03 06:50:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2013-12-19 21:19:22 +08:00
|
|
|
err := g_cmd.Dispatch(os.Args[1:])
|
2013-12-03 06:50:02 +08:00
|
|
|
if err != nil {
|
|
|
|
fmt.Printf("**err**: %v\n", err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|