ls: Make recursive and non-recursive behave the same way
Outputs for recursive today ``` $ mc ls -r /tmp/value/ [2016-01-25 12:27:01 PST] 52B test.go [2016-01-26 11:36:22 PST] 4.2KiB test.txt [2016-01-26 11:45:22 PST] 102B test/ [2016-01-26 11:45:22 PST] 4.2KiB test/README.md ``` and Outputs for non recursive today differ lexically. ``` $ mc ls /tmp/value/ [2016-01-26 11:45:22 PST] 102B test/ [2016-01-25 12:27:01 PST] 52B test.go [2016-01-26 11:36:22 PST] 4.2KiB test.txt ``` To fix this issue we need to capture the ending '/' as well part of the names while sorting the output. This patch addresses this problem.
This commit is contained in:
@@ -57,15 +57,15 @@ func fatalIf(err *probe.Error, msg string) {
|
||||
if globalDebug {
|
||||
errorMsg.CallTrace = err.CallTrace
|
||||
}
|
||||
json, err := json.Marshal(struct {
|
||||
json, e := json.Marshal(struct {
|
||||
Status string `json:"status"`
|
||||
Error errorMessage `json:"error"`
|
||||
}{
|
||||
Status: "error",
|
||||
Error: errorMsg,
|
||||
})
|
||||
if err != nil {
|
||||
console.Fatalln(probe.NewError(err))
|
||||
if e != nil {
|
||||
console.Fatalln(probe.NewError(e))
|
||||
}
|
||||
console.Println(string(json))
|
||||
console.Fatalln()
|
||||
@@ -94,15 +94,15 @@ func errorIf(err *probe.Error, msg string) {
|
||||
if globalDebug {
|
||||
errorMsg.CallTrace = err.CallTrace
|
||||
}
|
||||
json, err := json.Marshal(struct {
|
||||
json, e := json.Marshal(struct {
|
||||
Status string `json:"status"`
|
||||
Error errorMessage `json:"error"`
|
||||
}{
|
||||
Status: "error",
|
||||
Error: errorMsg,
|
||||
})
|
||||
if err != nil {
|
||||
console.Fatalln(probe.NewError(err))
|
||||
if e != nil {
|
||||
console.Fatalln(probe.NewError(e))
|
||||
}
|
||||
console.Println(string(json))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user