main.go 480 B

1234567891011121314151617181920212223242526272829303132
  1. package main
  2. import "surdeus.su/core/cli/mtool"
  3. import "runtime/debug"
  4. import "os"
  5. import "log"
  6. import "fmt"
  7. func main() {
  8. tool.Run(os.Args[1:])
  9. }
  10. var tool = mtool.T("amocli").Subs(
  11. getLead,
  12. getComs,
  13. updateComs,
  14. getContacts,
  15. getLeadTuple,
  16. mtool.T("version").Func(func(flags *mtool.Flags){
  17. bi, ok := debug.ReadBuildInfo()
  18. if !ok {
  19. log.Fatalf("could not read build info\n")
  20. return
  21. }
  22. fmt.Println(bi.Main.Version)
  23. }).Desc(
  24. "print program version",
  25. ),
  26. )