From 8c95a91e6469f9929f697525ccddb25bd7028422 Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 8 Jul 2020 20:31:57 +0200 Subject: [PATCH] update --- .gitignore | 2 -- cmd/root.go | 17 ++++++++++++++++- config.dist.yml | 10 ---------- 3 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 config.dist.yml diff --git a/.gitignore b/.gitignore index 32248a6..f1c181e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,3 @@ # Output of the go coverage tool, specifically when used with LiteIDE *.out - -config.prod.yml diff --git a/cmd/root.go b/cmd/root.go index e5e16ca..4d64e0f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -11,7 +11,11 @@ import ( "github.com/spf13/cobra" ) -var config string +// Verbose var +var Verbose bool + +// APIKey var +var APIKey string var rootCmd = &cobra.Command{ Use: "agent", @@ -21,6 +25,17 @@ Uptimedog and the agent is in early stages of development, and we'd love to hear feedback at `, } +func init() { + rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output") + rootCmd.PersistentFlags().StringVarP( + &APIKey, + "api_key", + "k", + "", + "Your Uptimedog API Key", + ) +} + // Execute runs cmd tool func Execute() { if err := rootCmd.Execute(); err != nil { diff --git a/config.dist.yml b/config.dist.yml deleted file mode 100644 index 9494d2a..0000000 --- a/config.dist.yml +++ /dev/null @@ -1,10 +0,0 @@ -# API Server Configs -api_server_url: ${UD_API_SERVER_URL:-https://api.uptimedog.io} -api_key: ${UD_API_KEY:-xxxxxxxxxxxxxxxx} - -# Log level, it can be debug, info, warn, error, panic, fatal -log_level: ${UD_AGENT_LOG_LEVEL:-warn} -# output can be stdout or abs path to log file /var/logs/ud_agent.log -log_output: ${UD_AGENT_LOG_OUTPUT:-stdout} -# Format can be json -log_format: ${UD_AGENT_LOG_FORMAT:-json}