Skip to content

Commit

Permalink
Add default values in 'get'
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Nov 20, 2019
1 parent c512678 commit d376663
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
13 changes: 5 additions & 8 deletions cmd/admin-config-get.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,15 @@ FLAGS:
EXAMPLES:
1. Get the current region setting on MinIO server.
{{.Prompt}} {{.HelpName}} play/ region
# US east region setting
name="us-east-1" state="on"
region name=us-east-1
2. Get the current notification settings for MQTT target on MinIO server
{{.Prompt}} {{.HelpName}} myminio/ notify_mqtt
# Notification settings for MQTT broker
notify_mqtt broker="" password="" queue_dir="" queue_limit="0" reconnect_interval="0s" state="off" keep_alive_interval="0s" qos="0" topic="" username=""
2. Get the current notification settings for Webhook target on MinIO server
{{.Prompt}} {{.HelpName}} myminio/ notify_webhook
notify_webhook endpoint="http://localhost:8080" auth_token= queue_limit=10000 queue_dir="/home/events"
3. Get the current compression settings on MinIO server
{{.Prompt}} {{.HelpName}} myminio/ compression
# Compression settings for csv and text files only
compression extensions=".txt,.csv" mime_types="text/*" state="on"
compression extensions=".txt,.csv" mime_types="text/*"
`,
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/admin-config-help.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ const HelpTmpl = `{{if ne .SubSys ""}}{{colorBlueBold "KEY:"}}
{{colorBlueBold "ARGS:"}}{{range .KeysHelp}}
{{if .Optional}}{{colorYellowBold .Key}}{{else}}{{colorRedBold .Key}}*{{end}}{{"\t"}}({{.Type}}){{"\t"}}{{.Description}}{{end}}{{else}}{{colorBlueBold "KEYS:"}}{{range .KeysHelp}}
{{colorRedBold .Key}}*{{"\t"}}{{.Description}}{{end}}{{end}}`
{{colorGreenBold .Key}}{{"\t"}}{{.Description}}{{end}}{{end}}`

var funcMap = template.FuncMap{
"colorBlueBold": color.New(color.FgBlue, color.Bold).SprintfFunc(),
"colorYellowBold": color.New(color.FgYellow, color.Bold).SprintfFunc(),
"colorCyanBold": color.New(color.FgCyan, color.Bold).SprintFunc(),
"colorRedBold": color.New(color.FgRed, color.Bold).SprintfFunc(),
"colorGreenBold": color.New(color.FgGreen, color.Bold).SprintfFunc(),
}

// HelpTemplate - captures config help template
Expand Down
6 changes: 3 additions & 3 deletions cmd/admin-config-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ FLAGS:
{{range .VisibleFlags}}{{.}}
{{end}}
EXAMPLES:
1. Enable WORM mode on MinIO server.
{{.Prompt}} {{.HelpName}} myminio/ worm state="on"
1. Enable webhook notification target for MinIO server.
{{.Prompt}} {{.HelpName}} myminio/ notify_webhook endpoint="http://localhost:8080/minio/events"
2. Change region name for the MinIO server to 'us-west-1'.
{{.Prompt}} {{.HelpName}} myminio/ region name="us-west-1" state="on"
{{.Prompt}} {{.HelpName}} myminio/ region name=us-west-1
`,
}

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ require (
)

replace github.com/gorilla/rpc v1.2.0+incompatible => github.com/gorilla/rpc v1.2.0

replace github.com/minio/minio => ../minio

0 comments on commit d376663

Please sign in to comment.