Module: Inch::CLI

Defined in:
lib/inch/cli.rb,
lib/inch/cli/arguments.rb,
lib/inch/cli/command/base.rb,
lib/inch/cli/command/diff.rb,
lib/inch/cli/command/list.rb,
lib/inch/cli/command/show.rb,
lib/inch/cli/trace_helper.rb,
lib/inch/cli/command/stats.rb,
lib/inch/cli/command_parser.rb,
lib/inch/cli/command/console.rb,
lib/inch/cli/command/inspect.rb,
lib/inch/cli/command/suggest.rb,
lib/inch/cli/yardopts_helper.rb,
lib/inch/cli/sparkline_helper.rb,
lib/inch/cli/command/base_list.rb,
lib/inch/cli/command/base_object.rb,
lib/inch/cli/command/output/base.rb,
lib/inch/cli/command/output/diff.rb,
lib/inch/cli/command/output/list.rb,
lib/inch/cli/command/output/show.rb,
lib/inch/cli/command/options/base.rb,
lib/inch/cli/command/options/diff.rb,
lib/inch/cli/command/options/list.rb,
lib/inch/cli/command/options/show.rb,
lib/inch/cli/command/output/stats.rb,
lib/inch/cli/command/options/stats.rb,
lib/inch/cli/command/output/console.rb,
lib/inch/cli/command/output/inspect.rb,
lib/inch/cli/command/output/suggest.rb,
lib/inch/cli/command/options/console.rb,
lib/inch/cli/command/options/inspect.rb,
lib/inch/cli/command/options/suggest.rb,
lib/inch/cli/command/options/base_list.rb,
lib/inch/cli/command/options/base_object.rb

Overview

The CLI module is tasked with the deconstruction of CLI calls into API calls.

See Also:

Defined Under Namespace

Modules: Command, SparklineHelper, TraceHelper, YardoptsHelper Classes: Arguments, CommandParser

Constant Summary collapse

COLUMNS =
get_term_columns

Class Method Summary collapse

Class Method Details

.get_term_columns(default = 80) ⇒ Fixnum

Returns the columns of the terminal window (defaults to 80)

Parameters:

  • default (Fixnum) (defaults to: 80)

    default value for columns

Returns:

  • (Fixnum)


12
13
14
15
16
17
18
# File 'lib/inch/cli.rb', line 12

def get_term_columns(default = 80)
  str = `stty size`
  rows_cols = str.split(' ').map(&:to_i)
  rows_cols[1] || default
rescue
  default
end