Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cobra for commands #420

Merged
merged 27 commits into from
Aug 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions dkron/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,39 +90,39 @@ func ConfigFlagSet() *flag.FlagSet {
c := DefaultConfig()
cmdFlags := flag.NewFlagSet("agent flagset", flag.ContinueOnError)

cmdFlags.Bool("server", false, "start dkron server")
cmdFlags.String("node-name", c.NodeName, "node name")
cmdFlags.String("bind-addr", c.BindAddr, "address to bind listeners to")
cmdFlags.String("advertise-addr", "", "address to advertise to other nodes")
cmdFlags.String("http-addr", c.HTTPAddr, "HTTP address")
cmdFlags.String("discover", c.Discover, "mDNS discovery name")
cmdFlags.Bool("server", false, "This node is running in server mode.")
cmdFlags.String("node-name", c.NodeName, "Name of this node. Must be unique in the cluster.")
cmdFlags.String("bind-addr", c.BindAddr, "Address to bind network listeners to.")
cmdFlags.String("advertise-addr", "", "Address used to advertise to other nodes in the cluster. By default, the bind address is advertised.")
cmdFlags.String("http-addr", c.HTTPAddr, "Address to bind the UI web server to. Only used when server.")
cmdFlags.String("discover", c.Discover, "A cluster name used to discovery peers. On networks that support multicast, this can be used to have peers join each other without an explicit join.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove or comment it as the feature is no developed, it's missleading

cmdFlags.String("backend", c.Backend, "store backend")
cmdFlags.StringSlice("backend-machine", c.BackendMachines, "store backend machines addresses")
cmdFlags.String("profile", c.Profile, "timing profile to use (lan, wan, local)")
cmdFlags.StringSlice("join", []string{}, "address of agent to join on startup")
cmdFlags.StringSlice("tag", []string{}, "tag pair, specified as key=value")
cmdFlags.String("keyspace", c.Keyspace, "key namespace to use")
cmdFlags.String("encrypt", "", "encryption key")
cmdFlags.String("profile", c.Profile, "Profile is used to control the timing profiles used. The default if not provided is lan.")
cmdFlags.StringSlice("join", []string{}, "An initial agent to join with. This flag can be specified multiple times.")
cmdFlags.StringSlice("tag", []string{}, "Tag can be specified multiple times to attach multiple key/value tag pairs to the given node. Specified as key=value")
cmdFlags.String("keyspace", c.Keyspace, "The keyspace to use. A prefix under all data is stored for this instance.")
cmdFlags.String("encrypt", "", "Key for encrypting network traffic. Must be a base64-encoded 16-byte key.")
cmdFlags.String("log-level", c.LogLevel, "Log level (debug, info, warn, error, fatal, panic), defaults to info")
cmdFlags.Int("rpc-port", c.RPCPort, "RPC port")
cmdFlags.Int("advertise-rpc-port", 0, "advertise RPC port")
cmdFlags.Int("rpc-port", c.RPCPort, "RPC Port used to communicate with clients. Only used when server. The RPC IP Address will be the same as the bind address.")
cmdFlags.Int("advertise-rpc-port", 0, "Use the value of rpc-port by default.")

// Notifications
cmdFlags.String("mail-host", "", "notification mail server host")
cmdFlags.String("mail-port", "", "port to use for the mail server")
cmdFlags.String("mail-username", "", "username for the mail server")
cmdFlags.String("mail-password", "", "password of the mail server")
cmdFlags.String("mail-from", "", "notification emails from address")
cmdFlags.String("mail-payload", "", "notification mail payload")
cmdFlags.String("mail-subject-prefix", c.MailSubjectPrefix, "notification mail subject prefix")

cmdFlags.String("webhook-url", "", "notification webhook url")
cmdFlags.String("webhook-payload", "", "notification webhook payload")
cmdFlags.StringSlice("webhook-header", []string{}, "notification webhook additional header")

cmdFlags.String("dog-statsd-addr", "", "DataDog Agent address")
cmdFlags.String("mail-host", "", "Mail server host address to use for notifications.")
cmdFlags.String("mail-port", "", "Mail server port.")
cmdFlags.String("mail-username", "", "Mail server username used for authentication.")
cmdFlags.String("mail-password", "", "Mail server password to use.")
cmdFlags.String("mail-from", "", "From email address to use.")
cmdFlags.String("mail-payload", "", "Notification mail payload.")
cmdFlags.String("mail-subject-prefix", c.MailSubjectPrefix, "Notification mail subject prefix.")

cmdFlags.String("webhook-url", "", "Webhook url to call for notifications.")
cmdFlags.String("webhook-payload", "", "Body of the POST request to send on webhook call.")
cmdFlags.StringSlice("webhook-header", []string{}, "Headers to use when calling the webhook URL. Can be specified multiple times.")

cmdFlags.String("dog-statsd-addr", "", "DataDog Agent address.")
cmdFlags.StringSlice("dog-statsd-tags", []string{}, "Datadog tags, specified as key:value")
cmdFlags.String("statsd-addr", "", "Statsd Address")
cmdFlags.String("statsd-addr", "", "Statsd Address.")

return cmdFlags
}
Expand Down