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