#!/usr/bin/env ruby require_relative '../lib/imdb_term' HELP_DOC = "" + "\n [command] " + "\n [description]" + "\n Example:" + "\n [example output]" + "\n" + "\n Commands:" + "\n" + "\n [this week] " + "\n Prints list of movies releasing this week" + "\n Example:" + "\n [id] - [title]" + "\n" + "\n [now playing] " + "\n Prints list of movies currently in theaters" + "\n Example:" + "\n [id] - [title]" + "\n" + "\n [search] " + "\n Prints top ten search results for movie title" + "\n Example:" + "\n [id] - [title] [(release year)]" + "\n" + "\n [details] " + "\n Prints extended details about movie" + "\n Example:" + "\n [title] [(release year)]" + "\n [content rating] | [runtime] | [genres]" + "\n Director(s): [director(s)]" + "\n Stars: [top billed stars]" + "\n Summary: [movie summary]" + "\n" + "\n [save] " + "\n If movie id is included will save information about movie with id " + "\n Otherwise saves all movies from previous command" + "\n Example:" + "\n [Movie saved] || [Movies saved] || [No movie to save]" + "\n" + "\n [list] [detailed]" + "\n If detailed option is included lists full details of all saved movies" + "\n Otherwise lists only id, name, and release year" + "\n Example:" + "\n [id] - [name] [(release year)]" + "\n or " + "\n [title] [(release year)]" + "\n [content rating] | [runtime] | [genres]" + "\n Director(s): [director(s)]" + "\n Stars: [top billed stars]" + "\n Summary: [movie summary]" cli = CLI.new loop do print "\nimdb_term: " input = gets.chomp.strip.downcase case input when 'quit' break when 'exit' break when 'help' puts HELP_DOC else cli.parse input end end