Sha256: 587537f8ad91bd379cdd1c33447a57b818d93f4963b2dda50a9b35747c9432f0

Contents?: true

Size: 849 Bytes

Versions: 6

Compression:

Stored size: 849 Bytes

Contents

ARGV << '--help' if ARGV.empty?

aliases = {
  "b"  => "build"
}

command = ARGV.shift
command = aliases[command] || command

case command
when 'build'
  require 'bookshop/commands/build'

when 'new'
  puts "Can't create a new Bookshop application within the directory of another, please change to a non-Bookshop directory first.\n"
  puts "Type 'bookshop' for help."

else
  puts "Error: Command not recognized" unless %w(-h --help).include?(command)
  puts <<-EOT
Usage: bookshop COMMAND [ARGS]

The most common bookshop commands are:
 build       Builds a new book from your html based upon arguments passed (short-cut alias: "b")
 new         Create a new bookshop project. "bookshop new name_of_book" creates a
             new book project called NameOfBook in "./name_of_book"

All commands can be run with -h for more information.
  EOT
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bookshop-0.0.14 lib/bookshop/commands.rb
bookshop-0.0.13 lib/bookshop/commands.rb
bookshop-0.0.12 lib/bookshop/commands.rb
bookshop-0.0.11 lib/bookshop/commands.rb
bookshop-0.0.9.1 lib/bookshop/commands.rb
bookshop-0.0.9 lib/bookshop/commands.rb