Class: Taggata::Cli::ListCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/taggata/cli/list.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/taggata/cli/list.rb', line 10

def execute
  case type
  when :file
    @db.find(Taggata::Persistent::File, {}).each { |file| puts file.path }
  when :directory
    @db.find(Taggata::Persistent::Directory, {}).each { |dir| puts dir.path }
  when :tag
    @db.find(Taggata::Persistent::Tag, {}).each { |tag| puts tag.name }
  end
end