main.go 956 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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: "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. }