Method: WavefrontCommandBase#opt_row

Defined in:
lib/wavefront-cli/commands/base.rb

#opt_row(opt_str, width, term_width = TW) ⇒ Object

Formats an option string.

Parameters:

  • opt_str (String)

    the option string

  • width (Integer)

    the width of the short + long options columns. This is used to indent following lines

  • term_width (Integer) (defaults to: TW)

    the width of the user’s terminal



145
146
147
148
# File 'lib/wavefront-cli/commands/base.rb', line 145

def opt_row(opt_str, width, term_width = TW)
  format("  %s %-#{width}s %s",
         *opt_str.split(/\s+/, 3)).opt_fold(term_width, width + 5)
end