]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - bin/lrc
Add dangling files
[rbdr/lyricli.rb] / bin / lrc
diff --git a/bin/lrc b/bin/lrc
index 52926e393728382fd97bca0a2871e381cd69718a..18371ab89487c4f4726d2e8333fcc40fb917d217 100755 (executable)
--- a/bin/lrc
+++ b/bin/lrc
@@ -1,4 +1,44 @@
 #!/usr/bin/env ruby -w
 
+require 'optparse'
 require 'lyricli'
+
+OptionParser.new do |opts|
+    opts.banner = %{Usage:
+    lrc [options]
+    lrc artist song
+    lrc                              You must enable other sources for this
+
+Options:
+}
+
+    opts.on("-e", "--enable SOURCE", "Enable SOURCE") do |source|
+      Lyricli.enable(source)
+      puts "#{source} has been enabled"
+      exit
+    end
+
+    opts.on("-l", "--list-sources", "List all available Sources") do
+      puts Lyricli.listSources()
+      exit
+    end
+
+    opts.on("-d", "--disable SOURCE", "Disable SOURCE") do |source|
+      Lyricli.disable(source)
+      puts "#{source} has been disabled"
+      exit
+    end
+
+    opts.on("-r", "--reset SOURCE", "Reset the configuration of SOURCE") do |source|
+      Lyricli.reset(source)
+      puts "#{source} has been disabled and all its configuration reset"
+      exit
+    end
+
+    opts.on("-t", "--title", "Shows the song title and artist") do
+      Lyricli.show_title = true
+    end
+end.parse!
+
+
 puts Lyricli.lyrics