1package lsl
2
3import (
4	"context"
5	"os"
6
7	"github.com/rclone/rclone/cmd"
8	"github.com/rclone/rclone/cmd/ls/lshelp"
9	"github.com/rclone/rclone/fs/operations"
10	"github.com/spf13/cobra"
11)
12
13func init() {
14	cmd.Root.AddCommand(commandDefinition)
15}
16
17var commandDefinition = &cobra.Command{
18	Use:   "lsl remote:path",
19	Short: `List the objects in path with modification time, size and path.`,
20	Long: `
21Lists the objects in the source path to standard output in a human
22readable format with modification time, size and path. Recurses by default.
23
24Eg
25
26    $ rclone lsl swift:bucket
27        60295 2016-06-25 18:55:41.062626927 bevajer5jef
28        90613 2016-06-25 18:55:43.302607074 canole
29        94467 2016-06-25 18:55:43.046609333 diwogej7
30        37600 2016-06-25 18:55:40.814629136 fubuwic
31
32` + lshelp.Help,
33	Run: func(command *cobra.Command, args []string) {
34		cmd.CheckArgs(1, 1, command, args)
35		fsrc := cmd.NewFsSrc(args)
36		cmd.Run(false, false, command, func() error {
37			return operations.ListLong(context.Background(), fsrc, os.Stdout)
38		})
39	},
40}
41