Permalink
Browse files

Adds support for multiple arguments to ./profile

Also adds a nice little help message.
  • Loading branch information...
icco committed Jan 17, 2012
1 parent 79d9576 commit 0dd06d895c4e81c39fd51b7b199dbfc1ca47e2bb
Showing with 17 additions and 2 deletions.
  1. +17 −2 profile
View
19 profile
@@ -6,5 +6,20 @@ require 'pp'
require 'domain-profiler'
require 'erb'
-profile = DomainProfiler.new(ARGV[0])
-puts ERB.new(File.read("view/text")).result
+def help
+ puts <<-help
+Usage:
+ $ ./profile domain.com
+help
+end
+
+if ($stdin.tty? && ARGV.empty?) || ARGV.delete('-h') || ARGV.delete('--help')
+ help
+else
+ profile = nil
+
+ ARGV.each do |domain|
+ profile = DomainProfiler.new(domain)
+ puts ERB.new(File.read("view/text")).result
+ end
+end

0 comments on commit 0dd06d8

Please sign in to comment.