From c5435ee854c4415fc0ca399b7c41def5e539546c Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 20 May 2015 02:52:02 -0700 Subject: [PATCH] Re-arrange command definitions, in order of cli command ordering --- cmd-options.go | 201 +++++++++++++++++++++++++------------------------ 1 file changed, 101 insertions(+), 100 deletions(-) diff --git a/cmd-options.go b/cmd-options.go index c3d1a19a..07c54c8e 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -24,105 +24,7 @@ import ( "github.com/minio/mc/pkg/console" ) -// List of commands -var accessCmd = cli.Command{ - Name: "access", - Usage: "Set permissions [public, private, readonly] for buckets and folders.", - Action: runAccessCmd, - CustomHelpTemplate: `Name: - mc {{.Name}} - {{.Usage}} - -USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} PERMISSION TARGET [TARGET...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} - -EXAMPLES: - - 1. Set bucket to "private" on Amazon S3 object storage - $ mc {{.Name}} private https://s3.amazonaws.com/burningman2011 - - 2. Set bucket to "public" on Amazon S3 object storage - $ mc {{.Name}} public https://s3.amazonaws.com/shared - - 3. Set bucket to "authenticated" on Amazon S3 object storage to provide read access to AuthenticatedUsers group - $ mc {{.Name}} authenticated https://s3.amazonaws.com/shared-authenticated - - 3. Set folder to world readwrite (chmod 777) on local filesystem - $ mc {{.Name}} public /shared/Music - -`, -} - -var catCmd = cli.Command{ - Name: "cat", - Usage: "Concantenate objects or files to standard output", - Action: runCatCmd, - CustomHelpTemplate: `NAME: - mc {{.Name}} - {{.Usage}} - -USAGE: - mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} SOURCE [SOURCE...] {{if .Description}} - -DESCRIPTION: - {{.Description}}{{end}}{{if .Flags}} - -FLAGS: - {{range .Flags}}{{.}} - {{end}}{{ end }} - -EXAMPLES: - 1. Concantenate an object from Amazon S3 object storage to mplayer standard input - $ mc {{.Name}} https://s3.amazonaws.com/ferenginar/klingon_opera_aktuh_maylotah.ogg | mplayer - - - 2. Concantenate a file from local filesystem to standard output. - $ mc {{.Name}} khitomer-accords.txt - - 3. Concantenate multiple files from local filesystem to standard output. - $ mc {{.Name}} *.txt > newfile.txt -`, -} - -var cpCmd = cli.Command{ - Name: "cp", - Usage: "Copy objects and files from multiple sources single destination", - Action: runCopyCmd, - CustomHelpTemplate: `NAME: - 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 }} - -EXAMPLES: - 1. Copy list of objects from local file system to Amazon S3 object storage - $ mc {{.Name}} Music/*.ogg https://s3.amazonaws.com/jukebox/ - - 2. Copy a bucket recursively from Minio object storage to Amazon S3 object storage - $ mc {{.Name}} http://play.minio.io:9000/photos/burningman2011... https://s3.amazonaws.com/private-photos/burningman/ - - 3. Copy multiple local folders recursively to Minio object storage - $ mc {{.Name}} backup/2014/... backup/2015/... http://play.minio.io:9000/archive/ - - 4. Copy a bucket recursively from aliased Amazon S3 object storage to local filesystem on Windows. - $ mc {{.Name}} s3:documents/2014/... C:\backup\2014 - - 5. Copy an object of non english characters to Amazon S3 object storage - $ mc {{.Name}} 本語 s3:andoria/本語 - -`, -} +//// List of commands var lsCmd = cli.Command{ Name: "ls", @@ -171,6 +73,42 @@ EXAMPLES: `, } +var cpCmd = cli.Command{ + Name: "cp", + Usage: "Copy objects and files from multiple sources single destination", + Action: runCopyCmd, + CustomHelpTemplate: `NAME: + 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 }} + +EXAMPLES: + 1. Copy list of objects from local file system to Amazon S3 object storage + $ mc {{.Name}} Music/*.ogg https://s3.amazonaws.com/jukebox/ + + 2. Copy a bucket recursively from Minio object storage to Amazon S3 object storage + $ mc {{.Name}} http://play.minio.io:9000/photos/burningman2011... https://s3.amazonaws.com/private-photos/burningman/ + + 3. Copy multiple local folders recursively to Minio object storage + $ mc {{.Name}} backup/2014/... backup/2015/... http://play.minio.io:9000/archive/ + + 4. Copy a bucket recursively from aliased Amazon S3 object storage to local filesystem on Windows. + $ mc {{.Name}} s3:documents/2014/... C:\backup\2014 + + 5. Copy an object of non english characters to Amazon S3 object storage + $ mc {{.Name}} 本語 s3:andoria/本語 + +`, +} + var syncCmd = cli.Command{ Name: "sync", Usage: "Copies files and objects from single source to multiple destinations", @@ -235,6 +173,35 @@ EXAMPLES: `, } +var catCmd = cli.Command{ + Name: "cat", + Usage: "Concantenate objects or files to standard output", + Action: runCatCmd, + CustomHelpTemplate: `NAME: + mc {{.Name}} - {{.Usage}} + +USAGE: + mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} SOURCE [SOURCE...] {{if .Description}} + +DESCRIPTION: + {{.Description}}{{end}}{{if .Flags}} + +FLAGS: + {{range .Flags}}{{.}} + {{end}}{{ end }} + +EXAMPLES: + 1. Concantenate an object from Amazon S3 object storage to mplayer standard input + $ mc {{.Name}} https://s3.amazonaws.com/ferenginar/klingon_opera_aktuh_maylotah.ogg | mplayer - + + 2. Concantenate a file from local filesystem to standard output. + $ mc {{.Name}} khitomer-accords.txt + + 3. Concantenate multiple files from local filesystem to standard output. + $ mc {{.Name}} *.txt > newfile.txt +`, +} + var mbCmd = cli.Command{ Name: "mb", Usage: "Make a bucket or a folder", @@ -265,6 +232,40 @@ EXAMPLES: `, } +var accessCmd = cli.Command{ + Name: "access", + Usage: "Set permissions [public, private, readonly, authenticated] for buckets and folders.", + Action: runAccessCmd, + CustomHelpTemplate: `Name: + mc {{.Name}} - {{.Usage}} + +USAGE: + mc {{.Name}}{{if .Flags}} [ARGS...]{{end}} PERMISSION TARGET [TARGET...] {{if .Description}} + +DESCRIPTION: + {{.Description}}{{end}}{{if .Flags}} + +FLAGS: + {{range .Flags}}{{.}} + {{end}}{{ end }} + +EXAMPLES: + + 1. Set bucket to "private" on Amazon S3 object storage + $ mc {{.Name}} private https://s3.amazonaws.com/burningman2011 + + 2. Set bucket to "public" on Amazon S3 object storage + $ mc {{.Name}} public https://s3.amazonaws.com/shared + + 3. Set bucket to "authenticated" on Amazon S3 object storage to provide read access to IAM Authenticated Users group + $ mc {{.Name}} authenticated https://s3.amazonaws.com/shared-authenticated + + 4. Set folder to world readwrite (chmod 777) on local filesystem + $ mc {{.Name}} public /shared/Music + +`, +} + // Configure minio client // // ---- @@ -320,7 +321,7 @@ EXAMPLES: // cp Copy objects and files from multiple sources to single destination // sync Copy objects and files from single source to multiple destionations // mb Make a bucket -// access Set permissions [public, private, readonly] for buckets and folders. +// access Set permissions [public, private, readonly, authenticated] for buckets and folders. // cat Concantenate an object to standard output // config Generate configuration "/home/harsha/.mc/config.json" file. // update Check for new software updates