From 54a9fdf42107ed66eddabc9938c7435e1b91a152 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 6 Jan 2018 14:41:36 +0000 Subject: [PATCH] ls2: remove in favour of lsf --- cmd/all/all.go | 1 - cmd/ls2/ls2.go | 46 ---------------------------------------------- 2 files changed, 47 deletions(-) delete mode 100644 cmd/ls2/ls2.go diff --git a/cmd/all/all.go b/cmd/all/all.go index 5dd2cce12..5351e320c 100644 --- a/cmd/all/all.go +++ b/cmd/all/all.go @@ -23,7 +23,6 @@ import ( _ "github.com/ncw/rclone/cmd/info" _ "github.com/ncw/rclone/cmd/listremotes" _ "github.com/ncw/rclone/cmd/ls" - _ "github.com/ncw/rclone/cmd/ls2" _ "github.com/ncw/rclone/cmd/lsd" _ "github.com/ncw/rclone/cmd/lsf" _ "github.com/ncw/rclone/cmd/lsjson" diff --git a/cmd/ls2/ls2.go b/cmd/ls2/ls2.go deleted file mode 100644 index 744386a7d..000000000 --- a/cmd/ls2/ls2.go +++ /dev/null @@ -1,46 +0,0 @@ -package ls2 - -import ( - "fmt" - - "github.com/ncw/rclone/cmd" - "github.com/ncw/rclone/fs" - "github.com/spf13/cobra" -) - -var ( - recurse bool -) - -func init() { - cmd.Root.AddCommand(commandDefintion) - commandDefintion.Flags().BoolVarP(&recurse, "recursive", "R", false, "Recurse into the listing.") -} - -var commandDefintion = &cobra.Command{ - Use: "ls2 remote:path", - Short: `List directories and objects in the path.`, - Hidden: true, - Run: func(command *cobra.Command, args []string) { - cmd.CheckArgs(1, 1, command, args) - fsrc := cmd.NewFsSrc(args) - cmd.Run(false, false, command, func() error { - return fs.Walk(fsrc, "", false, fs.ConfigMaxDepth(recurse), func(path string, entries fs.DirEntries, err error) error { - if err != nil { - fs.Stats.Error(err) - fs.Errorf(path, "error listing: %v", err) - return nil - } - for _, entry := range entries { - _, isDir := entry.(fs.Directory) - if isDir { - fmt.Println(entry.Remote() + "/") - } else { - fmt.Println(entry.Remote()) - } - } - return nil - }) - }) - }, -}