Method: QcloudCos::Cli#list
- Defined in:
- lib/qcloud_cos/cli.rb
#list(args, options) ⇒ Object
列出文件或者文件夹使用: $ qcloud-cos list [options] [dest_path]
107 108 109 110 111 112 113 114 115 116 |
# File 'lib/qcloud_cos/cli.rb', line 107 def list(args, ) path = args.shift || '/' opts = parse() opts[:num] = .num || 100 objects = QcloudCos.list(path, opts) objects.map do |object| File.join(path, object.is_a?(QcloudCos::FolderObject) ? "#{object.name}/" : object.name) end end |