]>
Commit | Line | Data |
---|---|---|
823e558b BB |
1 | #!/usr/bin/env ruby -w |
2 | ||
b9f550e9 | 3 | require 'optparse' |
823e558b | 4 | require 'lyricli' |
b9f550e9 | 5 | |
b9f550e9 BB |
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| | |
4f3dbb13 BB |
16 | Lyricli.enable(source) |
17 | puts "#{source} has been enabled" | |
b9f550e9 BB |
18 | exit |
19 | end | |
20 | ||
21 | opts.on("-l", "--list-sources", "List all available Sources") do | |
22 | puts Lyricli.sources | |
23 | exit | |
24 | end | |
25 | ||
26 | opts.on("-d", "--disable SOURCE", "Disable SOURCE") do |source| | |
4f3dbb13 BB |
27 | Lyricli.disable(source) |
28 | puts "#{source} has been disabled" | |
b9f550e9 BB |
29 | exit |
30 | end | |
31 | ||
32 | opts.on("-r", "--reset SOURCE", "Reset the configuration of SOURCE") do |source| | |
4f3dbb13 BB |
33 | Lyricli.reset(source) |
34 | puts "#{source} has been disabled and all its configuration reset" | |
b9f550e9 BB |
35 | exit |
36 | end | |
37 | ||
38 | opts.on("-h", "--help", "Shows this message") do | |
39 | puts opts | |
40 | exit | |
41 | end | |
42 | ||
43 | opts.on("-v", "--version", "Show version") do | |
44 | puts Lyricli.version | |
45 | exit | |
46 | end | |
47 | end.parse! | |
48 | ||
49 | ||
823e558b | 50 | puts Lyricli.lyrics |