Sha256: e0a713c227a360442607cc4ed5553745b6af5413bb231459712da478dff4a842

Contents?: true

Size: 1.69 KB

Versions: 3

Compression:

Stored size: 1.69 KB

Contents

#!/usr/bin/env ruby
require_relative '../lib/imdb_term'

HELP_DOC = "" +
"\n [command] <param>" +
"\n [description]" +
"\n Example:" +
"\n [example output]" +
"\n" +
"\n Commands:" +
"\n" +
"\n [this week] <no params>" +
"\n Prints list of movies releasing this week" +
"\n Example:" +
"\n [id] - [title]" +
"\n" +
"\n [now playing] <no params>" +
"\n Prints list of movies currently in theaters" +
"\n Example:" +
"\n [id] - [title]" +
"\n" +
"\n [search] <movie title>" +
"\n Prints top ten search results for movie title" +
"\n Example:" +
"\n [id] - [title] [(release year)]" +
"\n" +
"\n [details] <movie id>" +
"\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] <movie id>" +
"\n If movie id is included will save information about movie with id <movie 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
imdb_term-1.0.4 exe/imdb_term
imdb_term-1.0.2 exe/imdb_term
imdb_term-1.0.1 exe/imdb_term