Class: Dobby::Options
- Inherits:
-
Object
- Object
- Dobby::Options
- 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
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #parse(cli_args) ⇒ Object
Constructor Details
#initialize ⇒ Options
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) .parse!(args) args << '/var/lib/dpkg/status' if args.empty? [@options, args] end |