Class: SetecAstronomy::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/setec_astronomy/cli.rb

Instance Method Summary collapse

Instance Method Details

#copy(title) ⇒ Object



22
23
24
25
26
27
# File 'lib/setec_astronomy/cli.rb', line 22

def copy(title)
  keepass = database(options[:file], options[:gui])
  entry = keepass.entry(title)
  resign("#{title} not found") if entry.nil?
  Clipboard.copy entry.password
end

#search(pattern) ⇒ Object



12
13
14
15
16
17
# File 'lib/setec_astronomy/cli.rb', line 12

def search(pattern)
  keepass = database(options[:file], options[:gui])
  keepass.search(pattern).each do |match|
    puts "#{match.title} - #{match.notes}"
  end
end