X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/823e558b5cd2ec219d0fc7226c54f2ee7ad807d2..a1f64790dc2a69580dc73022686e6806b6bf7349:/bin/lrc?ds=sidebyside diff --git a/bin/lrc b/bin/lrc index 52926e3..3f71d87 100755 --- a/bin/lrc +++ b/bin/lrc @@ -1,4 +1,50 @@ #!/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.sources + 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("-h", "--help", "Shows this message") do + puts opts + exit + end + + opts.on("-v", "--version", "Show version") do + puts Lyricli.version + exit + end +end.parse! + + puts Lyricli.lyrics