diff --git a/CHANGELOG b/CHANGELOG index 69f960c9..c13eb233 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Use a default line length in help text if line length is otherwise too small [Jamis Buck] + * Fix incorrect reference to the 'setup' task in task documentation [rajeshduggal] * Don't try to kill the spawner process on deploy:stop if no spawner process exists [Jamis Buck] diff --git a/lib/capistrano/cli/help.rb b/lib/capistrano/cli/help.rb index a6987371..3affbffe 100644 --- a/lib/capistrano/cli/help.rb +++ b/lib/capistrano/cli/help.rb @@ -84,7 +84,9 @@ module Capistrano text.each_line do |line| indentation = line[/^\s+/] || "" indentation_size = indentation.split(//).inject(0) { |c,s| c + (s[0] == ?\t ? 8 : 1) } - lines = line.strip.gsub(/(.{1,#{output_columns - indentation_size}})(?:\s+|\Z)/, "\\1\n").split(/\n/) + line_length = output_columns - indentation_size + line_length = MIN_MAX_LEN if line_length < MIN_MAX_LEN + lines = line.strip.gsub(/(.{1,#{line_length}})(?:\s+|\Z)/, "\\1\n").split(/\n/) if lines.empty? formatted << "\n" else