mirror of
https://github.com/minio/mc.git
synced 2025-11-16 11:02:34 +03:00
Re-arrange command definitions, in order of cli command ordering
This commit is contained in:
201
cmd-options.go
201
cmd-options.go
@@ -24,105 +24,7 @@ import (
|
|||||||
"github.com/minio/mc/pkg/console"
|
"github.com/minio/mc/pkg/console"
|
||||||
)
|
)
|
||||||
|
|
||||||
// List of commands
|
//// 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/本語
|
|
||||||
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
|
|
||||||
var lsCmd = cli.Command{
|
var lsCmd = cli.Command{
|
||||||
Name: "ls",
|
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{
|
var syncCmd = cli.Command{
|
||||||
Name: "sync",
|
Name: "sync",
|
||||||
Usage: "Copies files and objects from single source to multiple destinations",
|
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{
|
var mbCmd = cli.Command{
|
||||||
Name: "mb",
|
Name: "mb",
|
||||||
Usage: "Make a bucket or a folder",
|
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
|
// Configure minio client
|
||||||
//
|
//
|
||||||
// ----
|
// ----
|
||||||
@@ -320,7 +321,7 @@ EXAMPLES:
|
|||||||
// cp Copy objects and files from multiple sources to single destination
|
// cp Copy objects and files from multiple sources to single destination
|
||||||
// sync Copy objects and files from single source to multiple destionations
|
// sync Copy objects and files from single source to multiple destionations
|
||||||
// mb Make a bucket
|
// 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
|
// cat Concantenate an object to standard output
|
||||||
// config Generate configuration "/home/harsha/.mc/config.json" file.
|
// config Generate configuration "/home/harsha/.mc/config.json" file.
|
||||||
// update Check for new software updates
|
// update Check for new software updates
|
||||||
|
|||||||
Reference in New Issue
Block a user