func main() { app.Version(buildVersion) kp.MustParse(app.Parse(os.Args[1:])) pwd, err := os.Getwd() app.FatalIfError(err, "pwd") fatalIfError(app, gc.VersionCheck(pwd, buildVersion), "version") showComments(pwd) }
func main() { app.Version(buildVersion) pwd, err := os.Getwd() app.FatalIfError(err, "pwd") fatalIfError(app, gc.VersionCheck(pwd, buildVersion), "version") switch kp.MustParse(app.Parse(os.Args[1:])) { case "find": findText(pwd, *text) case "index": indexComments(pwd) } }
func main() { app.Version(buildVersion) pwd, err := os.Getwd() app.FatalIfError(err, "pwd") fatalIfError(app, gc.VersionCheck(pwd, buildVersion), "version") switch kp.MustParse(app.Parse(os.Args[1:])) { case "config": app.FatalIfError(gc.ConfigureRemoteForComments(pwd, *configRemote).Failure, "git") fmt.Printf("Remote '%v' updated\n", *configRemote) case "delete": app.FatalIfError(gc.DeleteRemoteComment(pwd, *deleteRemote, *deleteComment).Failure, "git") fmt.Printf("Remote comment reference deleted\n") } }
func main() { app.Version(buildVersion) kp.MustParse(app.Parse(os.Args[1:])) pwd, err := os.Getwd() app.FatalIfError(err, "pwd") if *update { gc.VersionUpdate(pwd, buildVersion) return } fatalIfError(app, gc.VersionCheck(pwd, buildVersion), "version") if len(*deleteID) > 0 { app.FatalIfError(gc.DeleteComment(pwd, *deleteID).Failure, "git") fmt.Println("Comment deleted") } else { editComment(pwd) } }