cli.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package control
  2. import (
  3. "os"
  4. "github.com/codegangsta/cli"
  5. "github.com/rancherio/os/config"
  6. )
  7. func Main() {
  8. app := cli.NewApp()
  9. app.Name = os.Args[0]
  10. app.Usage = "Control and configure RancherOS"
  11. app.Version = config.VERSION
  12. app.Author = "Rancher Labs, Inc."
  13. app.EnableBashCompletion = true
  14. app.Commands = []cli.Command{
  15. {
  16. Name: "config",
  17. ShortName: "c",
  18. Usage: "configure settings",
  19. HideHelp: true,
  20. Subcommands: configSubcommands(),
  21. },
  22. {
  23. Name: "dev",
  24. ShortName: "d",
  25. Usage: "dev spec",
  26. HideHelp: true,
  27. SkipFlagParsing: true,
  28. Action: devAction,
  29. },
  30. {
  31. Name: "env",
  32. ShortName: "e",
  33. Usage: "env command",
  34. HideHelp: true,
  35. SkipFlagParsing: true,
  36. Action: envAction,
  37. },
  38. {
  39. Name: "service",
  40. ShortName: "s",
  41. Usage: "service settings",
  42. HideHelp: true,
  43. Subcommands: serviceSubCommands(),
  44. },
  45. //{
  46. // Name: "reload",
  47. // ShortName: "a",
  48. // Usage: "reload configuration of a service and restart the container",
  49. // Action: reload,
  50. //},
  51. {
  52. Name: "os",
  53. Usage: "operating system upgrade/downgrade",
  54. HideHelp: true,
  55. Subcommands: osSubcommands(),
  56. },
  57. {
  58. Name: "tls",
  59. Usage: "setup tls configuration",
  60. HideHelp: true,
  61. Subcommands: tlsConfCommands(),
  62. },
  63. }
  64. app.Run(os.Args)
  65. }