diff --git a/access-main.go b/access-main.go index 70356d56..cefb4121 100644 --- a/access-main.go +++ b/access-main.go @@ -29,20 +29,19 @@ import ( // Set access permissions. var accessCmd = cli.Command{ Name: "access", - Usage: "Set access permissions.", + Usage: "Set or get access permissions.", Action: mainAccess, CustomHelpTemplate: `Name: mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} [OPTION] PERMISSION TARGET [TARGET ...] {{if .Description}} + mc {{.Name}} set PERMISSION TARGET [TARGET ...] + mc {{.Name}} get TARGET [TARGET ...] + + PERMISSION = private | readonly | public | authorized {{if .Description}} DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + {{.Description}}{{end}} EXAMPLES: @@ -55,7 +54,7 @@ EXAMPLES: 3. Set bucket to "authenticated" on Amazon S3 cloud storage to provide read access to IAM Authenticated Users group. $ mc {{.Name}} set authorized https://s3.amazonaws.com/shared-authenticated - 4. Set folder to world readwrite (chmod 777) on local filesystem. + 4. Get bucket permissions. $ mc {{.Name}} get https://s3.amazonaws.com/shared `, } diff --git a/cat-main.go b/cat-main.go index c08e4c31..6f0e1981 100644 --- a/cat-main.go +++ b/cat-main.go @@ -35,14 +35,7 @@ var catCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} SOURCE [SOURCE...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} SOURCE [SOURCE...] EXAMPLES: 1. Concantenate an object from Amazon S3 cloud storage to mplayer standard input. @@ -55,7 +48,7 @@ EXAMPLES: $ mc {{.Name}} *.txt > newfile.txt 4. Concatenate a non english file name from Amazon S3 cloud storage. - $ mc {{.Name}} s3:andoria/本語 > /tmp/本語 + $ mc {{.Name}} s3/andoria/本語 > /tmp/本語 5. Behave like operating system tool ‘cat’, used for shell aliases. $ echo "Hello, World!" | mc --mimic cat diff --git a/config-main.go b/config-main.go index bec9cc73..df20ca28 100644 --- a/config-main.go +++ b/config-main.go @@ -46,7 +46,11 @@ var configCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} OPERATION OPTION [ARGS...] + mc {{.Name}} add OPTION [ARGS...] + mc {{.Name}} list OPTION [ARGS...] + mc {{.Name}} remove OPTION [ARGS...] + + OPTION = alias EXAMPLES: 1. Add aliases for a URL diff --git a/cp-main.go b/cp-main.go index acb805f0..fe2966fe 100644 --- a/cp-main.go +++ b/cp-main.go @@ -41,14 +41,7 @@ var cpCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} SOURCE [SOURCE...] TARGET {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} SOURCE [SOURCE...] TARGET EXAMPLES: 1. Copy list of objects from local file system to Amazon S3 cloud storage. @@ -61,10 +54,13 @@ EXAMPLES: $ mc {{.Name}} backup/2014/... backup/2015/... https://play.minio.io:9000/archive/ 4. Copy a bucket recursively from aliased Amazon S3 cloud storage to local filesystem on Windows. - $ mc {{.Name}} s3:documents/2014/... C:\backup\2014 + $ mc {{.Name}} s3/documents/2014/... C:\backup\2014 5. Copy an object of non english characters to Amazon S3 cloud storage. - $ mc {{.Name}} 本語 s3:andoria/本語 + $ mc {{.Name}} 本語 s3/andoria/本語 + + 6. Copy local folder with space characters to Amazon S3 cloud storage. + $ mc {{.Name}} 'workdir/documents/May 2014...' s3/miniocloud `, } diff --git a/diff-main.go b/diff-main.go index 81374f95..748c7ec4 100644 --- a/diff-main.go +++ b/diff-main.go @@ -34,18 +34,11 @@ var diffCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} FIRST SECOND {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} FIRST SECOND EXAMPLES: 1. Compare foo.ogg on a local filesystem with bar.ogg on Amazon AWS cloud storage. - $ mc {{.Name}} foo.ogg https://s3.amazonaws.com/jukebox/bar.ogg + $ mc {{.Name}} foo.ogg https://s3.amazonaws.com/jukebox/bar.ogg 2. Compare two different folders on a local filesystem. $ mc {{.Name}} ~/Photos /Media/Backup/Photos diff --git a/ls-main.go b/ls-main.go index 076fbad6..fcda1e41 100644 --- a/ls-main.go +++ b/ls-main.go @@ -34,14 +34,7 @@ var lsCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} TARGET [TARGET ...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} TARGET [TARGET ...] EXAMPLES: 1. List buckets on Amazon S3 cloud storage. @@ -60,12 +53,18 @@ EXAMPLES: [2015-03-31 14:46:33 PDT] 15.00MiB Gowron\Khitomer Conference Details.pdf 4. List files with non english characters on Amazon S3 cloud storage. - $ mc ls s3:andoria/本... + $ mc ls s3/andoria/本... [2015-05-19 17:21:49 PDT] 41B 本語.pdf [2015-05-19 17:24:19 PDT] 41B 本語.txt [2015-05-19 17:28:22 PDT] 41B 本語.md - 5. Behave like operating system tool ‘ls’, used for shell aliases. + 5. List files with space characters on Amazon S3 cloud storage. + $ mc ls 's3/miniocloud/Community Files/' + [2015-05-19 17:21:49 PDT] 41B 本語.pdf + [2015-05-19 17:24:19 PDT] 41B 本語.txt + [2015-05-19 17:28:22 PDT] 41B 本語.md + + 6. Behave like operating system tool ‘ls’, used for shell aliases. $ mc --mimic ls ... [2015-05-19 17:28:22 PDT] 41B 本語.md diff --git a/mb-main.go b/mb-main.go index 7b121c2c..d69950be 100644 --- a/mb-main.go +++ b/mb-main.go @@ -35,14 +35,7 @@ var mbCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} TARGET [TARGET ...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} TARGET [TARGET ...] EXAMPLES: 1. Create a bucket on Amazon S3 cloud storage. diff --git a/mirror-main.go b/mirror-main.go index 80d0e951..54500e70 100644 --- a/mirror-main.go +++ b/mirror-main.go @@ -41,14 +41,7 @@ var mirrorCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} SOURCE TARGET [TARGET ...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + mc {{.Name}} SOURCE TARGET [TARGET ...] EXAMPLES: 1. Mirror a bucket recursively from Minio cloud storage to multiple buckets on Amazon S3 cloud storage. @@ -58,10 +51,13 @@ EXAMPLES: $ mc {{.Name}} backup/... https://play.minio.io:9000/archive https://s3.amazonaws.com/archive 3. Mirror a bucket from aliased Amazon S3 cloud storage to multiple folders on Windows. - $ mc {{.Name}} s3:documents/2014/... C:\backup\2014 C:\shared\volume\backup\2014 + $ mc {{.Name}} s3/documents/2014/... C:\backup\2014 C:\shared\volume\backup\2014 4. Mirror a local folder of non english character recursively to Amazon s3 cloud storage and Minio cloud storage. - $ mc {{.Name}} 本語/... s3:mylocaldocuments play:backup + $ mc {{.Name}} 本語/... s3/mylocaldocuments play/backup + + 5. Mirror a local folder with space characters to Amazon s3 cloud storage + $ mc {{.Name}} 'workdir/documents/Aug 2015...' s3/miniocloud `, } diff --git a/pkg/client/s3/s3.go b/pkg/client/s3/s3.go index 1b952591..1fed3587 100644 --- a/pkg/client/s3/s3.go +++ b/pkg/client/s3/s3.go @@ -177,7 +177,7 @@ func (c *s3Client) Stat() (*client.Content, *probe.Error) { objectMetadata := new(client.Content) bucket, object := c.url2BucketAndObject() switch { - // valid case for s3:... + // valid case for s3/... case bucket == "" && object == "": for bucket := range c.api.ListBuckets() { if bucket.Err != nil { diff --git a/session-main.go b/session-main.go index 82f08639..5a665016 100644 --- a/session-main.go +++ b/session-main.go @@ -37,24 +37,22 @@ var sessionCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} [SESSION] {{if .Description}} + mc {{.Name}} list + mc {{.Name}} resume SESSION-ID + mc {{.Name}} clear SESSION-ID -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + SESSION-ID = $SESSION | all EXAMPLES: 1. List sessions $ mc {{.Name}} list + ygVIpSJs -> [2015-08-29 15:25:12 PDT] cp /usr/bin... test 2. Resume session - $ mc {{.Name}} resume [SESSION] + $ mc {{.Name}} resume ygVIpSJs 3. Clear session - $ mc {{.Name}} clear [SESSION]|[all] + $ mc {{.Name}} clear ygVIpSJs `, } diff --git a/share-main.go b/share-main.go index fb5970cb..a6c77ae7 100644 --- a/share-main.go +++ b/share-main.go @@ -38,14 +38,9 @@ var shareCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} TARGET [DURATION=h|m|s] {{if .Description}} + mc {{.Name}} TARGET [DURATION] -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} + DURATION = NN[h|m|s] [DEFAULT=168h] EXAMPLES: 1. Generate URL for sharing, with a default expiry of 7 days. @@ -54,8 +49,9 @@ EXAMPLES: 2. Generate URL for sharing, with an expiry of 10 minutes. $ mc {{.Name}} https://s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz 10m - 3. Generate list of URLs for sharing a folder recursively, with expiration of 1 hour each. - $ mc {{.Name}} https://s3.amazonaws.com/backup... 1h + 3. Generate list of URLs for sharing a folder recursively, with expiration of 5 days each. + $ mc {{.Name}} https://s3.amazonaws.com/backup... 120h + `, } diff --git a/update-main.go b/update-main.go index a11ea139..505c54c8 100644 --- a/update-main.go +++ b/update-main.go @@ -38,7 +38,8 @@ var updateCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} + mc {{.Name}} release + mc {{.Name}} experimental EXAMPLES: 1. Check for new official releases diff --git a/version-main.go b/version-main.go index 422c5580..7b86a589 100644 --- a/version-main.go +++ b/version-main.go @@ -35,10 +35,8 @@ var versionCmd = cli.Command{ mc {{.Name}} - {{.Usage}} USAGE: - mc {{.Name}} {{if .Description}} + mc {{.Name}} -DESCRIPTION: - {{.Description}}{{end}} `, }