From 4fa61ea14adb1f49753a8aaf01f63f467af2e773 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Mon, 29 Mar 2010 08:21:58 -0400 Subject: [PATCH 1/2] Use readlines, not read --- bin/rocco | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rocco b/bin/rocco index 5f03958..e070f83 100755 --- a/bin/rocco +++ b/bin/rocco @@ -14,7 +14,7 @@ require 'optparse' # Write usage message to stdout and exit. def usage(stream=$stderr, status=1) - stream.puts File.read(__FILE__). + stream.puts File.readlines(__FILE__). grep(/^#\//). map { |line| line.sub(/^#. ?/, '') }. join From c1837853d65a6d6c35cabacdd3720301be0dabe3 Mon Sep 17 00:00:00 2001 From: Colin Shea Date: Mon, 29 Mar 2010 08:22:42 -0400 Subject: [PATCH 2/2] Use spaces, not tabs. --- bin/rocco | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rocco b/bin/rocco index e070f83..a78d073 100755 --- a/bin/rocco +++ b/bin/rocco @@ -35,8 +35,8 @@ options = {} ARGV.options { |o| o.program_name = File.basename($0) o.on("-o", "--output=DIR") { |dir| output_dir = dir } - o.on("-l", "--language=LANG") { |lang| options[:language] = lang } - o.on("-c", "--comment-chars=CHARS") { |chars| options[:comment_chars] = Regexp.escape(chars) } + o.on("-l", "--language=LANG") { |lang| options[:language] = lang } + o.on("-c", "--comment-chars=CHARS") { |chars| options[:comment_chars] = Regexp.escape(chars) } o.on_tail("-h", "--help") { usage($stdout, 0) } o.parse! } or abort_with_note