main.go 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package main
  2. import (
  3. "log"
  4. "os"
  5. "github.com/jsmartx/giter/cmd"
  6. "github.com/urfave/cli"
  7. )
  8. var version = "dev"
  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: "show",
  27. Usage: "Show git user detail",
  28. Action: cmd.Show,
  29. },
  30. {
  31. Name: "add",
  32. Aliases: []string{"new"},
  33. Usage: "Add one custom user config",
  34. Action: cmd.Add,
  35. },
  36. {
  37. Name: "update",
  38. Usage: "Update one custom user config",
  39. Action: cmd.Update,
  40. },
  41. {
  42. Name: "del",
  43. Aliases: []string{"rm"},
  44. Usage: "Delete one custom user config",
  45. Action: cmd.Delete,
  46. },
  47. }
  48. err := app.Run(os.Args)
  49. if err != nil {
  50. log.Fatal(err)
  51. }
  52. }