From 4da1d24405103beb90d5ef02411fd294d1eabe17 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Sat, 6 Jun 2015 15:11:03 -0700 Subject: [PATCH] prefix with parent path for dir... case --- ls.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ls.go b/ls.go index 9c199b88..af6beff2 100644 --- a/ls.go +++ b/ls.go @@ -18,6 +18,7 @@ package main import ( "fmt" + "path/filepath" "runtime" "strings" @@ -74,6 +75,10 @@ func doList(clnt client.Client, targetURL string, recursive bool, recursivePrefi err = contentCh.Err break } + + if recursive && recursivePrefix != "" { + contentCh.Content.Name = filepath.Join(filepath.Base(targetURL), contentCh.Content.Name) + } console.Println(parseContent(contentCh.Content)) } if err != nil {