lib/datapimp/cli/list.rb in datapimp-1.0.3 vs lib/datapimp/cli/list.rb in datapimp-1.0.4

- old
+ new

@@ -23,8 +23,27 @@ puts "=====" puts "datapimp sync data #{ lines.first.split(/\t/).first } --type google-spreadsheet" puts "\n\n" end end - end +command "list folders" do |c| + c.syntax= "datapimp list folders [OPTIONS]" + c.description= "lists folders in a remote service" + + c.option '--type SERVICE', String, 'Which service to search: dropbox, google, amazon' + c.option '--filter PATTERN', String, 'Filter the results matching PATTERN' + + c.action do |args, options| + type = options.type.to_sym + + case + when type == :dropbox + puts Datapimp::Sync.dropbox.ls + when type == :google + puts Datapimp::Sync.google.api + when type == :amazon + puts Datapimp::Sync.amazon.storage + end + end +end