main.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package main
  2. import (
  3. "os"
  4. "github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli"
  5. "github.com/coreos/etcd/etcdctl/command"
  6. "github.com/coreos/etcd/version"
  7. )
  8. func main() {
  9. app := cli.NewApp()
  10. app.Name = "etcdctl"
  11. app.Version = version.Version
  12. app.Usage = "A simple command line client for etcd."
  13. app.Flags = []cli.Flag{
  14. cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"},
  15. cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"},
  16. cli.StringFlag{Name: "output, o", Value: "simple", Usage: "output response in the given format (`simple` or `json`)"},
  17. cli.StringFlag{Name: "peers, C", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"127.0.0.1:4001\")"},
  18. }
  19. app.Commands = []cli.Command{
  20. command.NewMakeCommand(),
  21. command.NewMakeDirCommand(),
  22. command.NewRemoveCommand(),
  23. command.NewRemoveDirCommand(),
  24. command.NewGetCommand(),
  25. command.NewLsCommand(),
  26. command.NewSetCommand(),
  27. command.NewSetDirCommand(),
  28. command.NewUpdateCommand(),
  29. command.NewUpdateDirCommand(),
  30. command.NewWatchCommand(),
  31. command.NewExecWatchCommand(),
  32. command.NewMemberCommand(),
  33. }
  34. app.Run(os.Args)
  35. }