From b1f5e78980aa26e599de60b2255f58735a17f8cb Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 1 Dec 2020 16:34:43 -0800 Subject: [PATCH] fix indentation/help across commands (#3512) --- cmd/admin-bucket.go | 2 +- cmd/du-main.go | 18 ++++++++--------- cmd/ilm-add.go | 4 ++-- cmd/{ilm-set.go => ilm-edit.go} | 10 ++++----- cmd/ls-main.go | 1 - cmd/policy-main.go | 36 ++++++++++++++++----------------- cmd/retention-set.go | 1 - 7 files changed, 34 insertions(+), 38 deletions(-) rename cmd/{ilm-set.go => ilm-edit.go} (93%) diff --git a/cmd/admin-bucket.go b/cmd/admin-bucket.go index 0095afe1..5b1fdfb8 100644 --- a/cmd/admin-bucket.go +++ b/cmd/admin-bucket.go @@ -19,8 +19,8 @@ package cmd import "github.com/minio/cli" var adminBucketSubcommands = []cli.Command{ - adminBucketQuotaCmd, adminBucketRemoteCmd, + adminBucketQuotaCmd, } var adminBucketCmd = cli.Command{ diff --git a/cmd/du-main.go b/cmd/du-main.go index a4937514..a868a203 100644 --- a/cmd/du-main.go +++ b/cmd/du-main.go @@ -69,20 +69,20 @@ FLAGS: {{range .VisibleFlags}}{{.}} {{end}} ENVIRONMENT VARIABLES: - MC_ENCRYPT_KEY: list of comma delimited prefix=secret values + MC_ENCRYPT_KEY: list of comma delimited prefix=secret values EXAMPLES: - 1. Summarize disk usage of 'jazz-songs' bucket recursively. - {{.Prompt}} {{.HelpName}} s3/jazz-songs + 1. Summarize disk usage of 'jazz-songs' bucket recursively. + {{.Prompt}} {{.HelpName}} s3/jazz-songs - 2. Summarize disk usage of 'louis' prefix in 'jazz-songs' bucket upto two levels. - {{.Prompt}} {{.HelpName}} --depth=2 s3/jazz-songs/louis/ + 2. Summarize disk usage of 'louis' prefix in 'jazz-songs' bucket upto two levels. + {{.Prompt}} {{.HelpName}} --depth=2 s3/jazz-songs/louis/ - 3. Summarize disk usage of 'jazz-songs' bucket at a fixed date/time - {{.Prompt}} {{.HelpName}} --rewind "2020.01.01" s3/jazz-songs/ + 3. Summarize disk usage of 'jazz-songs' bucket at a fixed date/time + {{.Prompt}} {{.HelpName}} --rewind "2020.01.01" s3/jazz-songs/ - 4. Summarize disk usage of 'jazz-songs' bucket with all objects versions - {{.Prompt}} {{.HelpName}} --versions s3/jazz-songs/ + 4. Summarize disk usage of 'jazz-songs' bucket with all objects versions + {{.Prompt}} {{.HelpName}} --versions s3/jazz-songs/ `, } diff --git a/cmd/ilm-add.go b/cmd/ilm-add.go index 087ddca7..b13d7c68 100644 --- a/cmd/ilm-add.go +++ b/cmd/ilm-add.go @@ -59,9 +59,9 @@ EXAMPLES: --storage-class "GLACIER" s3/mybucket/doc 4. Add expiry and transition days rules on a prefix in mybucket for a MinIO transition target specified by label "hdd_tier". - "hdd_tier" is the label specified when adding a remote target with "mc admin bucket remote add --service ilm --label hdd_tier" + "hdd_tier" is the label specified when adding a remote target with "mc admin bucket remote add --service ilm --label hdd_tier" {{.Prompt}} {{.HelpName}} --expiry-days "300" --transition-days "200" \ - --storage-class "hdd_tier" myminio/mybucket/doc + --storage-class "hdd_tier" myminio/mybucket/doc `, } diff --git a/cmd/ilm-set.go b/cmd/ilm-edit.go similarity index 93% rename from cmd/ilm-set.go rename to cmd/ilm-edit.go index fa05c0fe..1fbe1005 100644 --- a/cmd/ilm-set.go +++ b/cmd/ilm-edit.go @@ -44,17 +44,15 @@ FLAGS: {{range .VisibleFlags}}{{.}} {{end}} DESCRIPTION: - modify a lifecycle configuration rule with given id. + Modify a lifecycle configuration rule with given id. EXAMPLES: 1. Modify the expiration date for an existing rule with id "rHTY.a123". - {{.Prompt}} {{.HelpName}} --id "rHTY.a123" \ - --expiry-date "2020-09-17" s3/mybucket + {{.Prompt}} {{.HelpName}} --id "rHTY.a123" --expiry-date "2020-09-17" s3/mybucket 2. Modify the expiration and transition days for an existing rule with id "hGHKijqpo123". - {{.Prompt}} {{.HelpName}} --id "hGHKijqpo123" \ - --expiry-days "300" --transition-days "200" \ - --storage-class "GLACIER" s3/mybucket + {{.Prompt}} {{.HelpName}} --id "hGHKijqpo123" --expiry-days "300" \ + --transition-days "200" --storage-class "GLACIER" s3/mybucket `, } diff --git a/cmd/ls-main.go b/cmd/ls-main.go index c667e3ca..58ceabb7 100644 --- a/cmd/ls-main.go +++ b/cmd/ls-main.go @@ -93,7 +93,6 @@ EXAMPLES: 8. List all contents versions if the bucket versioning is enabled. {{.Prompt}} {{.HelpName}} --versions s3/mybucket - `, } diff --git a/cmd/policy-main.go b/cmd/policy-main.go index 64906cdb..291051fa 100644 --- a/cmd/policy-main.go +++ b/cmd/policy-main.go @@ -67,32 +67,32 @@ FILE: A valid S3 policy JSON filepath. EXAMPLES: - 1. Set bucket to "download" on Amazon S3 cloud storage. - {{.Prompt}} {{.HelpName}} set download s3/burningman2011 + 1. Set bucket to "download" on Amazon S3 cloud storage. + {{.Prompt}} {{.HelpName}} set download s3/burningman2011 - 2. Set bucket to "public" on Amazon S3 cloud storage. - {{.Prompt}} {{.HelpName}} set public s3/shared + 2. Set bucket to "public" on Amazon S3 cloud storage. + {{.Prompt}} {{.HelpName}} set public s3/shared - 3. Set bucket to "upload" on Amazon S3 cloud storage. - {{.Prompt}} {{.HelpName}} set upload s3/incoming + 3. Set bucket to "upload" on Amazon S3 cloud storage. + {{.Prompt}} {{.HelpName}} set upload s3/incoming - 4. Set policy to "public" for bucket with prefix on Amazon S3 cloud storage. - {{.Prompt}} {{.HelpName}} set public s3/public-commons/images + 4. Set policy to "public" for bucket with prefix on Amazon S3 cloud storage. + {{.Prompt}} {{.HelpName}} set public s3/public-commons/images - 5. Set a custom prefix based bucket policy on Amazon S3 cloud storage using a JSON file. - {{.Prompt}} {{.HelpName}} set-json /path/to/policy.json s3/public-commons/images + 5. Set a custom prefix based bucket policy on Amazon S3 cloud storage using a JSON file. + {{.Prompt}} {{.HelpName}} set-json /path/to/policy.json s3/public-commons/images - 6. Get bucket permissions. - {{.Prompt}} {{.HelpName}} get s3/shared + 6. Get bucket permissions. + {{.Prompt}} {{.HelpName}} get s3/shared - 7. Get bucket permissions in JSON format. - {{.Prompt}} {{.HelpName}} get-json s3/shared + 7. Get bucket permissions in JSON format. + {{.Prompt}} {{.HelpName}} get-json s3/shared - 8. List policies set to a specified bucket. - {{.Prompt}} {{.HelpName}} list s3/shared + 8. List policies set to a specified bucket. + {{.Prompt}} {{.HelpName}} list s3/shared - 9. List public object URLs recursively. - {{.Prompt}} {{.HelpName}} --recursive links s3/shared/ + 9. List public object URLs recursively. + {{.Prompt}} {{.HelpName}} --recursive links s3/shared/ `, } diff --git a/cmd/retention-set.go b/cmd/retention-set.go index 08ec8b49..998fecc8 100644 --- a/cmd/retention-set.go +++ b/cmd/retention-set.go @@ -90,7 +90,6 @@ EXAMPLES: 5. Set default lock retention configuration for a bucket $ {{.HelpName}} --default governance 30d myminio/mybucket/ - `} func parseSetRetentionArgs(cliCtx *cli.Context) (target, versionID string, recursive bool, timeRef time.Time, withVersions bool, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit, bypass, bucketMode bool) {