main.go 872 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package main
  2. import (
  3. "github.com/jsmartx/giter/cmd"
  4. "github.com/urfave/cli"
  5. "log"
  6. "os"
  7. )
  8. const version = "0.0.1"
  9. func main() {
  10. app := cli.NewApp()
  11. app.Usage = "Git users manager"
  12. app.Version = version
  13. app.Commands = []cli.Command{
  14. {
  15. Name: "list",
  16. Aliases: []string{"ls"},
  17. Usage: "List all the git user config",
  18. Action: cmd.List,
  19. },
  20. {
  21. Name: "use",
  22. Usage: "Change git user config to username",
  23. Action: cmd.Use,
  24. },
  25. {
  26. Name: "add",
  27. Aliases: []string{"new"},
  28. Usage: "Add one custom user config",
  29. Action: cmd.Add,
  30. },
  31. {
  32. Name: "update",
  33. Usage: "Update one custom user config",
  34. Action: cmd.Update,
  35. },
  36. {
  37. Name: "del",
  38. Aliases: []string{"rm"},
  39. Usage: "Delete one custom user config",
  40. Action: cmd.Delete,
  41. },
  42. }
  43. err := app.Run(os.Args)
  44. if err != nil {
  45. log.Fatal(err)
  46. }
  47. }