class Optimist::Parser

def width #:nodoc:

:nodoc:
def width #:nodoc:
  @width ||= if $stdout.tty?
               begin
                 require 'io/console'
                 w = IO.console.winsize.last
                 w.to_i > 0 ? w : 80
               rescue LoadError, NoMethodError, Errno::ENOTTY, Errno::EBADF, Errno::EINVAL
                 legacy_width
               end
             else
               80
             end
end