main.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. Copyright 2014 CoreOS, Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package main
  14. import (
  15. "os"
  16. "github.com/coreos/etcd/Godeps/_workspace/src/github.com/codegangsta/cli"
  17. "github.com/coreos/etcd/etcdctl/command"
  18. "github.com/coreos/etcd/version"
  19. )
  20. func main() {
  21. app := cli.NewApp()
  22. app.Name = "etcdctl"
  23. app.Version = version.Version
  24. app.Usage = "A simple command line client for etcd."
  25. app.Flags = []cli.Flag{
  26. cli.BoolFlag{Name: "debug", Usage: "output cURL commands which can be used to reproduce the request"},
  27. cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"},
  28. cli.StringFlag{Name: "output, o", Value: "simple", Usage: "output response in the given format (`simple` or `json`)"},
  29. cli.StringFlag{Name: "peers, C", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"127.0.0.1:4001\")"},
  30. }
  31. app.Commands = []cli.Command{
  32. command.NewMakeCommand(),
  33. command.NewMakeDirCommand(),
  34. command.NewRemoveCommand(),
  35. command.NewRemoveDirCommand(),
  36. command.NewGetCommand(),
  37. command.NewLsCommand(),
  38. command.NewSetCommand(),
  39. command.NewSetDirCommand(),
  40. command.NewUpdateCommand(),
  41. command.NewUpdateDirCommand(),
  42. command.NewWatchCommand(),
  43. command.NewExecWatchCommand(),
  44. command.NewMemberCommand(),
  45. }
  46. app.Run(os.Args)
  47. }