Пример #1
0
func run(cmd *gocli.Command, args []string) {
	if len(args) == 0 {
		cmd.Usage()
		os.Exit(2)
	}

	app.InitOrDie()

	defer prompt.RecoverCancel()

	if err := runMain(args); err != nil {
		errs.Fatal(err)
	}
}
Пример #2
0
func run(cmd *gocli.Command, args []string) {
	app.InitOrDie()

	defer prompt.RecoverCancel()

	var err error
	switch {
	case len(args) != 0:
		err = postRevisions(args...)
	case flagParent != "":
		err = postBranch(flagParent)
	default:
		err = postTip()
	}
	if err != nil {
		errs.Fatal(err)
	}
}