]> git.r.bdr.sh - rbdr/lyricli.rb/blob - bin/lrc
18371ab89487c4f4726d2e8333fcc40fb917d217
[rbdr/lyricli.rb] / bin / lrc
1 #!/usr/bin/env ruby -w
2
3 require 'optparse'
4 require 'lyricli'
5
6 OptionParser.new do |opts|
7 opts.banner = %{Usage:
8 lrc [options]
9 lrc artist song
10 lrc You must enable other sources for this
11
12 Options:
13 }
14
15 opts.on("-e", "--enable SOURCE", "Enable SOURCE") do |source|
16 Lyricli.enable(source)
17 puts "#{source} has been enabled"
18 exit
19 end
20
21 opts.on("-l", "--list-sources", "List all available Sources") do
22 puts Lyricli.listSources()
23 exit
24 end
25
26 opts.on("-d", "--disable SOURCE", "Disable SOURCE") do |source|
27 Lyricli.disable(source)
28 puts "#{source} has been disabled"
29 exit
30 end
31
32 opts.on("-r", "--reset SOURCE", "Reset the configuration of SOURCE") do |source|
33 Lyricli.reset(source)
34 puts "#{source} has been disabled and all its configuration reset"
35 exit
36 end
37
38 opts.on("-t", "--title", "Shows the song title and artist") do
39 Lyricli.show_title = true
40 end
41 end.parse!
42
43
44 puts Lyricli.lyrics