Skip to content

Commit

Permalink
+ quick deletion (API change)
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Sep 30, 2012
1 parent cb46003 commit aa2029e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/playa/terminal.rb
Expand Up @@ -7,6 +7,7 @@ class Terminal < Clamp::Command

parameter "[pattern]", "a pattern locating your mp3 files", :default => '~/Music/*/*/*/*.mp3'
option "--[no-]autoplay", :flag, "autoplay after startup or when searching", :default => true
option "--[no-]quick-delete", :flag, "quick deletion of whole words", :default => true
option "--[no-]index", :flag, "forces an indexing run instead of loading", :default => false
option "--[no-]info", :flag, "information on startup", :default => true
option ["-V", "--volume"], "VOLUME", "player volume", :default => 0.5 do |v|
Expand Down Expand Up @@ -34,6 +35,7 @@ def execute
search = Playa::Search.new music
player = Playa::Player.new volume
shortcuts = Playa::Shortcuts.new
backspace_pattern = quick_delete? ? /(?:\w+?\:?|.)$/ : /.$/

if music.size.zero?
Playa.logger.send :warn, %Q{Sorry, I could not find any songs using your pattern "#{pattern}". Exiting.}
Expand Down Expand Up @@ -108,7 +110,7 @@ def execute
info = "(repeat #{repeat_one ? 'this' : 'all'})"
next
when "\x7F"
query.chop!
query.gsub! backspace_pattern, ''
when "A" # up arrow
if gobble == 1 # almost finished gobbling
player.increase_volume
Expand Down

0 comments on commit aa2029e

Please sign in to comment.