Skip to content

Commit

Permalink
Add default values in 'get' (#2962)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored and nitisht committed Nov 21, 2019
1 parent 5dda155 commit 3dc37f1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 56 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
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ module github.com/minio/mc
go 1.13

require (
contrib.go.opencensus.io/exporter/ocagent v0.6.0 // indirect
github.com/DataDog/zstd v1.4.4 // indirect
github.com/cheggaaa/pb v1.0.28
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect
github.com/hashicorp/go-retryablehttp v0.6.3 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.9.4 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/mattn/go-colorable v0.1.1
github.com/mattn/go-isatty v0.0.7
github.com/mattn/go-runewidth v0.0.5 // indirect
github.com/minio/cli v1.22.0
github.com/minio/minio v0.0.0-20191119214813-7cdb67680e72
github.com/minio/minio v0.0.0-20191121003501-a9b87c0a16cd
github.com/minio/minio-go/v6 v6.0.42
github.com/minio/sha256-simd v0.1.1
github.com/mitchellh/go-homedir v1.1.0
Expand All @@ -29,6 +27,7 @@ require (
go.uber.org/zap v1.11.0 // indirect
golang.org/x/net v0.0.0-20190923162816-aa69164e4478
golang.org/x/text v0.3.2
google.golang.org/grpc v1.22.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
gopkg.in/h2non/filetype.v1 v1.0.5
gopkg.in/yaml.v2 v2.2.2
Expand Down
Loading

0 comments on commit 3dc37f1

Please sign in to comment.