Skip to content

Commit

Permalink
add generate method
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Nov 19, 2014
1 parent f612dbd commit 8f704ac
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions bin/unenviable
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,30 @@
# encoding: utf-8
require 'unenviable'

required, optional, forbidden = Unenviable.check
CHECK_USAGE = 'unenviable check'
GENERATE_USAGE = 'unenviable generate'

if required.size > 0
puts ""
required.each { |req| }
def show_errors(errors)
return if errors.size == 0
puts 'Usage: ' + errors[0]
errors[1..-1].each { |e| puts ' ' + e }
exit 1
end

forbidden.each
def check_params(params)
case params[0]
when 'check'
when 'generate'
else
show_errors([CHECK_USAGE, GENERATE_USAGE])
end
end

check_params(ARGV)

case ARGV[0]
when 'check'
Unenviable.check
when 'generate'
Unenviable.generate
end

0 comments on commit 8f704ac

Please sign in to comment.