Permalink
Browse files

Add error message if no files given

  • Loading branch information...
brynary committed Dec 9, 2008
1 parent 866b5ca commit 5a0265157da6a342d23519ec2bdd8ecf6b8fe740
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/features2cards/cli.rb
View
@@ -22,6 +22,11 @@ def self.load_cucumber
end
def execute
+ if files.empty?
+ usage
+ exit
+ end
+
generate_pdf(cards)
end
@@ -56,5 +61,10 @@ def generate_pdf(cards)
Prawn::Document.generate_cards(cards)
end
+ def usage
+ $stderr.puts "ERROR: No feature files given"
+ $stderr.puts "usage: features2cards <feature files>"
+ end
+
end
end

0 comments on commit 5a02651

Please sign in to comment.