main.go 1.1 KB

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