diff --git a/lib/rails_best_practices/command.rb b/lib/rails_best_practices/command.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_best_practices/command.rb
+++ b/lib/rails_best_practices/command.rb
@@ -44,7 +44,7 @@ OptionParser.new do |opts|
   opts.on("--with-textmate", "open file by textmate in html format") do
     options["with-textmate"] = true
   end
-  
+
   opts.on("--with-sublime", "open file by sublime in html format") do
     options["with-sublime"] = true
   end
@@ -122,6 +122,11 @@ OptionParser.new do |opts|
   opts.parse!
 end
 
+unless File.exists?(ARGV.first)
+  puts "#{ARGV.first} doesn't exist"
+  exit 1
+end
+
 if options["generate"]
   RailsBestPractices::Analyzer.new(ARGV.first).generate
 else
output warning if directory doesn't exist