<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,14 @@
 module Oyster
-  VERSION = '0.9.1'
+  VERSION = '0.9.2'
   
   LONG_NAME   = /^--([a-z\[][a-z0-9\]\-]+)$/i
   SHORT_NAME  = /^-([a-z0-9]+)$/i
   
   HELP_INDENT = 7
-  HELP_WIDTH  = 72
+  HELP_WIDTH  = 80
+  
+  STOP_FLAG   = '--'
+  NEGATOR     = /^no-/
   
   WINDOWS = RUBY_PLATFORM.split('-').any? { |part| part =~ /mswin\d*/i }
   
@@ -19,7 +22,7 @@ module Oyster
   end
   
   def self.is_name?(string)
-    !string.nil? and !!(string =~ LONG_NAME || string =~ SHORT_NAME || string == '--')
+    !string.nil? and !!(string =~ LONG_NAME || string =~ SHORT_NAME || string == STOP_FLAG)
   end
 end
 </diff>
      <filename>lib/oyster.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,7 +49,7 @@ module Oyster
       output = {:unclaimed =&gt; []}
       
       while token = input.shift
-        if token == '--'
+        if token == STOP_FLAG
           output[:unclaimed] = output[:unclaimed] + input
           break
         end
@@ -61,8 +61,8 @@ module Oyster
         
         input = short.scan(/./).map { |s| &quot;-#{s}&quot; } + input and next if short and short.size &gt; 1
         
-        negative = !!(long &amp;&amp; long =~ /^no-/)
-        long.sub!(/^no-/, '') if negative
+        negative = !!(long &amp;&amp; long =~ NEGATOR)
+        long.sub!(NEGATOR, '') if negative
         
         option ||= self[long] || self[short]
         output[:unclaimed] &lt;&lt; token and next unless option
@@ -95,34 +95,53 @@ module Oyster
       initial
     end
     
-    def help
-      display(@data[:name],         1, 'NAME')
-      display(@data[:synopsis],     1, 'SYNOPSIS', false, true)
-      display(@data[:description],  1, 'DESCRIPTION')
-      puts &quot;\n#{ bold }OPTIONS#{ normal }&quot;
+    def help(stream = $stdout)
+      render(stream, @data[:name],         1, 'NAME')
+      render(stream, @data[:synopsis],     1, 'SYNOPSIS', false, true)
+      render(stream, @data[:description],  1, 'DESCRIPTION')
+      
+      i = 0
+      stream.puts &quot;\n#{ bold }OPTIONS#{ normal }&quot;
       each do |option|
-        display(option.help_names.join(', '), 1, nil, false, true)
-        display(option.description, 2)
-        puts &quot;\n&quot;
+        render(stream, option.help_names.join(', '), 1, nil, false, true)
+        render(stream, option.description, 2)
+        i += 1
+        stream.puts &quot;\n&quot; if i &lt; @options.size
       end
-      display(@data[:notes],        1, 'NOTES')
-      display(@data[:author],       1, 'AUTHOR')
-      display(@data[:copyright],    1, 'COPYRIGHT')
+      
+      render(stream, @data[:notes],        1, 'NOTES')
+      render(stream, @data[:author],       1, 'AUTHOR')
+      render(stream, @data[:copyright],    1, 'COPYRIGHT')
+      stream.puts &quot;\n&quot;
       self
     end
     
-    def display(text, level = 1, title = nil, join = true, man = false)
+    # Plagiarised from Trollop, Copyright (c) 2008 William Morgan
+    def display_width
+      @width ||= begin
+                   require 'curses'
+                   Curses.init_screen
+                   x = Curses.cols
+                   Curses.close_screen
+                   x
+                 rescue
+                   HELP_WIDTH
+                 end
+      @width - HELP_INDENT
+    end
+    
+    def render(stream, text, level = 1, title = nil, join = true, man = false)
       return unless text
-      puts &quot;\n&quot; + format(&quot;#{ bold }#{ title }#{ normal }&quot;, level - 1) if title
+      stream.puts &quot;\n&quot; + format(&quot;#{ normal }#{ bold }#{ title }#{ normal }&quot;, level - 1) if title
       text = man_format(text) if man
-      puts format(text, level, join)
+      stream.puts format(text, level, join)
     end
     
     def format(text, level = 1, join = true)
       lines   = text.split(/\n/)
       outdent = lines.inject(1000) { |n,s| [s.scan(/^\s*/).first.size, n].min }
       indent  = level * HELP_INDENT
-      width   = HELP_WIDTH - indent
+      width   = display_width - indent
       
       lines.map { |line|
         line.sub(/\s*$/, '').sub(%r{^\s{#{outdent}}}, '')</diff>
      <filename>lib/oyster/specification.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,13 @@ class OysterTest &lt; Test::Unit::TestCase
       Which binary to use. You can change the executable used to format the output
       of this command, setting it to your scripting language of choice. This is just
       a lot of text to make sure help formatting works.
+      
+        class WeCan
+          attr_writer :write_code
+          
+          def in_option_descriptions
+          end
+        end
       EOS
       
       integer :status,    :default =&gt; 200,</diff>
      <filename>test/test_oyster.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fc632ba4fc2dcbfa09778d00132c930992d0ee12</id>
    </parent>
  </parents>
  <author>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </author>
  <url>http://github.com/jcoglan/oyster/commit/467079732a4481656e760d6d069d97e21bffc792</url>
  <id>467079732a4481656e760d6d069d97e21bffc792</id>
  <committed-date>2009-06-19T04:31:20-07:00</committed-date>
  <authored-date>2009-06-19T04:31:20-07:00</authored-date>
  <message>Various help formatting tweaks.</message>
  <tree>e6e486397d605e7c664bee8c2d2f5040959a9844</tree>
  <committer>
    <name>James Coglan</name>
    <email>jcoglan@googlemail.com</email>
  </committer>
</commit>
