main.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package main
  2. import (
  3. "os"
  4. "regexp"
  5. )
  6. var (
  7. cache map[string]bool
  8. appRoot string
  9. regexes map[string]*regexp.Regexp
  10. assignRegex *regexp.Regexp
  11. report []ReportElem
  12. )
  13. func init() {
  14. appRoot, _ = os.Getwd()
  15. cache = make(map[string]bool)
  16. // TODO update regex to look for things like:
  17. // client("fewafewakwafejwkaf",
  18. regexes = map[string]*regexp.Regexp{
  19. "github": regexp.MustCompile(`[g|G][i|I][t|T][h|H][u|U][b|B].*(=|:|:=|<-).*\w+.*`),
  20. "aws": regexp.MustCompile(`[a|A][w|W][s|S].*(=|:=|:|<-).*\w+.*`),
  21. "heroku": regexp.MustCompile(`[h|H][e|E][r|R][o|O][k|K][u|U].*(=|:=|:|<-).*\w+.*`),
  22. "facebook": regexp.MustCompile(`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*(=|:=|:|<-).*\w+.*`),
  23. "twitter": regexp.MustCompile(`[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*(=|:=|:|<-).*\w+.*`),
  24. "reddit": regexp.MustCompile(`[r|R][e|E][d|D][d|D][i|I][t|T].*(=|:=|:|<-).*\w+.*`),
  25. "twilio": regexp.MustCompile(`[t|T][w|W][i|I][l|L][i|I][o|O].*(=|:=|:|<-).*\w+.*`),
  26. }
  27. assignRegex = regexp.MustCompile(`(=|:|:=|<-)`)
  28. }
  29. func main() {
  30. args := os.Args[1:]
  31. opts := parseOptions(args)
  32. start(opts)
  33. }
  34. func start(opts *Options) {
  35. if opts.Repo != "" {
  36. repoStart(opts.Repo)
  37. }
  38. }