#! /usr/bin/env ruby
require 'LOLastfm/client'

client = LOLastfm::Client.new(ARGV.empty? ? '~/.LOLastfm/socket' : ARGV.first)
client.send_command :commands, :glyr

if STDOUT.tty?
	require 'ncursesw'

	abort 'ncurses UI not implemented yet, redirect the output to something'
else
	client.send_command :lyrics?
	response = client.read_response

	if response.first
		puts response.first['content']
	else
		exit 1
	end
end
