diff --git a/cmd-config.go b/cmd-config.go index 8c6a9eed..87182ad1 100644 --- a/cmd-config.go +++ b/cmd-config.go @@ -42,7 +42,7 @@ type configV1 struct { Hosts map[string]*hostConfig } -// getMcConfigDir - construct minio client configuration directory +// getMcConfigDir - construct minio client config folder func getMcConfigDir() (string, error) { u, err := user.Current() if err != nil { @@ -57,7 +57,7 @@ func getMcConfigDir() (string, error) { } } -// createMcConfigDir - create minio client configuration directory +// createMcConfigDir - create minio client config folder func createMcConfigDir() error { p, err := getMcConfigDir() if err != nil { diff --git a/cmd-options.go b/cmd-options.go index ee3443d9..5c5a14cc 100644 --- a/cmd-options.go +++ b/cmd-options.go @@ -188,7 +188,7 @@ EXAMPLES: } mbCmd = cli.Command{ Name: "mb", - Usage: "Make a directory or bucket", + Usage: "Make a bucket or a folder", Action: runMakeBucketCmd, CustomHelpTemplate: `NAME: mc {{.Name}} - {{.Usage}} diff --git a/cp-url.go b/cp-url.go index b8f5f897..025ba4cb 100644 --- a/cp-url.go +++ b/cp-url.go @@ -91,10 +91,10 @@ func getNewTargetURLObject(targetURL string, sourceURL string) (newTargetURL str func getNewTargetURLFilesystem(targetURL string, sourceURL string) (newTargetURL string, err error) { st, err := os.Stat(targetURL) if err != nil { - return "", iodine.New(errIsNotDIR{path: targetURL}, nil) + return "", iodine.New(errIsNotFolder{path: targetURL}, nil) } if !st.IsDir() { - return "", iodine.New(errIsNotDIR{path: targetURL}, nil) + return "", iodine.New(errIsNotFolder{path: targetURL}, nil) } switch client.GetType(sourceURL) { case client.Filesystem: diff --git a/cp.go b/cp.go index 0a3069eb..ae8de910 100644 --- a/cp.go +++ b/cp.go @@ -64,10 +64,10 @@ func doCopySingleSource(methods clientMethods, sourceURL, targetURL string, sour if err != nil { return iodine.New(err, nil) } - // check if its a directory, construct the new TargetURL, if not fallback + // check if its a folder, construct the new TargetURL, if not fallback newTargetURL, err := getNewTargetURL(targetURL, sourceURL) switch iodine.ToError(err).(type) { - case errIsNotDIR: + case errIsNotFolder: return doCopy(methods, reader, md5hex, length, targetURL, targetConfig) case errIsNotBucket: return doCopy(methods, reader, md5hex, length, targetURL, targetConfig) diff --git a/docs/commands/mb.md b/docs/commands/mb.md index 7b1513bf..c4b7529b 100644 --- a/docs/commands/mb.md +++ b/docs/commands/mb.md @@ -2,7 +2,7 @@ ```go NAME: - mc mb - Make a directory or bucket + mc mb - Make a bucket or a folder USAGE: mc mb TARGET [TARGET...] diff --git a/docs/index.md b/docs/index.md index d9e82224..3b6aedd5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,26 +19,27 @@ USAGE: mc [global flags] command [command flags] [arguments...] VERSION: - 1e2357c0c9cbdb6d5cb46de4c0d9ef28 + 9b3f0a923efd39cd98487c08b761dbd0 BUILD: - 2015-04-28 10:20:42.810860315 -0700 PDT + 2015-04-28 11:59:38.77226527 -0700 PDT COMMANDS: ls List files and objects - cp Copy objects and files - cat Concantenate objects or files to standard output - mb Make a directory or bucket - access Set permissions [public, private, readonly] for buckets and folders. - config Generate configuration "/home/harsha/.mc/config.json" file. - update Check for new software updates + cp Copy objects and files from multiple sources single destination + sync Copies files and objects from single source to multiple destinations + cat Concantenate objects or files to standard output + mb Make a bucker or a folder + access Set permissions [public, private, readonly] for buckets and folders. + config Generate configuration "/home/harsha/.mc/config.json" file. + update Check for new software updates GLOBAL FLAGS: --theme "minimal" Choose a console theme from this list [*minimal*, nocolor, white] - --debug Enable HTTP tracing - --quiet, -q Supress chatty console output - --retry "5" Number of retry count - --version, -v print the version + --debug Enable HTTP tracing + --quiet, -q Supress chatty console output + --retry "5" Number of retry count + --version, -v print the version ``` diff --git a/errors.go b/errors.go index c011236d..4abaec77 100644 --- a/errors.go +++ b/errors.go @@ -114,10 +114,10 @@ func (e errInvalidSource) Error() string { return "Invalid source " + e.path } -type errIsNotDIR struct { +type errIsNotFolder struct { path string } -func (e errIsNotDIR) Error() string { - return "Not a directory " + e.path +func (e errIsNotFolder) Error() string { + return "Not a folder " + e.path } diff --git a/ls.go b/ls.go index d7e02767..4bbbeddf 100644 --- a/ls.go +++ b/ls.go @@ -54,7 +54,7 @@ func printItem(date time.Time, v int64, name string, fileType os.FileMode) { } } -// doList - list all entities inside a directory +// doList - list all entities inside a folder func doList(clnt client.Client, targetURL string) error { var err error for itemCh := range clnt.List() { @@ -70,7 +70,7 @@ func doList(clnt client.Client, targetURL string) error { return nil } -// doListRecursive - list all entities inside directories and sub-directories recursively +// doListRecursive - list all entities inside folders and sub-folders recursively func doListRecursive(clnt client.Client, targetURL string) error { var err error for itemCh := range clnt.ListRecursive() { diff --git a/main.go b/main.go index ad657eb3..4d4ae527 100644 --- a/main.go +++ b/main.go @@ -32,12 +32,12 @@ import ( "github.com/minio-io/minio/pkg/utils/log" ) -// Check for the environment early on and gracefuly report. +// Check for the environment early on and gracefully report. func checkConfig() { _, err := user.Current() if err != nil { log.Debug.Println(iodine.New(err, nil)) - console.Fatalln("Unable to determine user's home directory") + console.Fatalln("Unable to determine current user") } // If config doesn't exist, do not attempt to read it diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index bd755568..020b1e0d 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -49,7 +49,7 @@ func New(path string) client.Client { func (f *fsClient) fsStat() (os.FileInfo, error) { st, err := os.Stat(filepath.Clean(f.path)) if os.IsNotExist(err) { - return nil, iodine.New(FileNotFound{path: f.path}, nil) + return nil, iodine.New(NotFound{path: f.path}, nil) } if err != nil { return nil, iodine.New(err, nil) @@ -64,7 +64,7 @@ func (f *fsClient) Get() (io.ReadCloser, int64, string, error) { return nil, 0, "", iodine.New(err, nil) } if item.FileType.IsDir() { - return nil, 0, "", iodine.New(FileISDir{path: f.path}, nil) + return nil, 0, "", iodine.New(ISFolder{path: f.path}, nil) } body, err := os.Open(f.path) if err != nil { @@ -95,7 +95,7 @@ func (f *fsClient) GetPartial(offset, length int64) (io.ReadCloser, int64, strin return nil, 0, "", iodine.New(err, nil) } if item.FileType.IsDir() { - return nil, 0, "", iodine.New(FileISDir{path: f.path}, nil) + return nil, 0, "", iodine.New(ISFolder{path: f.path}, nil) } if offset > item.Size || (offset+length-1) > item.Size { return nil, 0, "", iodine.New(client.InvalidRange{Offset: offset}, nil) @@ -123,7 +123,7 @@ func (f *fsClient) GetPartial(offset, length int64) (io.ReadCloser, int64, strin return body, length, md5Str, nil } -// List - list files and directories inside a directory +// List - list files and folders func (f *fsClient) List() <-chan client.ItemOnChannel { itemCh := make(chan client.ItemOnChannel) go f.list(itemCh) @@ -187,7 +187,7 @@ func (f *fsClient) list(itemCh chan client.ItemOnChannel) { } } -// ListRecursive - list all files and directories recursivelys +// ListRecursive - list files and folders recursively func (f *fsClient) ListRecursive() <-chan client.ItemOnChannel { itemCh := make(chan client.ItemOnChannel) go f.listRecursive(itemCh) diff --git a/pkg/client/fs/fs_errors.go b/pkg/client/fs/fs_errors.go index 181bb21a..3fa3655a 100644 --- a/pkg/client/fs/fs_errors.go +++ b/pkg/client/fs/fs_errors.go @@ -21,23 +21,23 @@ type GenericFileError struct { path string } -// FileNotFound (ENOENT) - file not found -type FileNotFound GenericFileError +// NotFound (ENOENT) - file not found +type NotFound GenericFileError -func (e FileNotFound) Error() string { +func (e NotFound) Error() string { return "Requested file " + e.path + " not found" } -// FileISDir (EISDIR) - accessed file is a directory -type FileISDir GenericFileError +// ISFolder (EISDIR) - accessed file is a folder +type ISFolder GenericFileError -func (e FileISDir) Error() string { - return "Requested file " + e.path + " is a directory" +func (e ISFolder) Error() string { + return "Requested file " + e.path + " is a folder" } -// FileNotDir (ENOTDIR) - accessed file is not a directory -type FileNotDir GenericFileError +// NotFolder (ENOTDIR) - accessed file is not a folder +type NotFolder GenericFileError -func (e FileNotDir) Error() string { - return "Requested file " + e.path + " is not a directory" +func (e NotFolder) Error() string { + return "Requested file " + e.path + " is not a folder" }