Class: SyntaxTree::CLI::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/cli.rb

Overview

This represents all of the options that can be passed to the CLI. It is responsible for parsing the list and then returning the file paths at the end.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



382
383
384
385
386
387
388
# File 'lib/syntax_tree/cli.rb', line 382

def initialize
  @ignore_files = []
  @plugins = []
  @print_width = DEFAULT_PRINT_WIDTH
  @scripts = []
  @formatter_options = Formatter::Options.new
end

Instance Attribute Details

#formatter_optionsObject (readonly)

Returns the value of attribute formatter_options.



376
377
378
# File 'lib/syntax_tree/cli.rb', line 376

def formatter_options
  @formatter_options
end

#ignore_filesObject (readonly)

Returns the value of attribute ignore_files.



376
377
378
# File 'lib/syntax_tree/cli.rb', line 376

def ignore_files
  @ignore_files
end

#pluginsObject (readonly)

Returns the value of attribute plugins.



376
377
378
# File 'lib/syntax_tree/cli.rb', line 376

def plugins
  @plugins
end

Returns the value of attribute print_width.



376
377
378
# File 'lib/syntax_tree/cli.rb', line 376

def print_width
  @print_width
end

#scriptsObject (readonly)

Returns the value of attribute scripts.



376
377
378
# File 'lib/syntax_tree/cli.rb', line 376

def scripts
  @scripts
end

Instance Method Details

#parse(arguments) ⇒ Object



390
391
392
# File 'lib/syntax_tree/cli.rb', line 390

def parse(arguments)
  parser.parse!(arguments)
end