]> git.r.bdr.sh - rbdr/lyricli.rb/blame - bin/lrc
Add specs, startin with util
[rbdr/lyricli.rb] / bin / lrc
CommitLineData
823e558b
BB
1#!/usr/bin/env ruby -w
2
b9f550e9 3require 'optparse'
823e558b 4require 'lyricli'
b9f550e9
BB
5
6
7options = {}
8OptionParser.new do |opts|
9 opts.banner = %{Usage:
10 lrc [options]
11 lrc artist song
12 lrc You must enable other sources for this
13
14Options:
15}
16
17 opts.on("-e", "--enable SOURCE", "Enable SOURCE") do |source|
4f3dbb13
BB
18 Lyricli.enable(source)
19 puts "#{source} has been enabled"
b9f550e9
BB
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|
4f3dbb13
BB
29 Lyricli.disable(source)
30 puts "#{source} has been disabled"
b9f550e9
BB
31 exit
32 end
33
34 opts.on("-r", "--reset SOURCE", "Reset the configuration of SOURCE") do |source|
4f3dbb13
BB
35 Lyricli.reset(source)
36 puts "#{source} has been disabled and all its configuration reset"
b9f550e9
BB
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
49end.parse!
50
51
823e558b 52puts Lyricli.lyrics