Class: Dobby::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/dobby/options.rb

Overview

Parsing of command line options and arguments.

Constant Summary collapse

EXITING_OPTIONS =
%i[version verbose_version].freeze

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



23
24
25
# File 'lib/dobby/options.rb', line 23

def initialize
  @options = {}
end

Instance Method Details

#parse(cli_args) ⇒ Object



27
28
29
30
31
32
# File 'lib/dobby/options.rb', line 27

def parse(cli_args)
  args = args_from_file.concat(args_from_env).concat(cli_args)
  define_options.parse!(args)
  args << '/var/lib/dpkg/status' if args.empty?
  [@options, args]
end