Module: Beaker::Options::SubcommandOptionsParser
- Defined in:
- lib/beaker/options/subcommand_options_file_parser.rb
Overview
A set of functions to read options files
Class Method Summary collapse
-
.parse_subcommand_options(argv) ⇒ OptionsHash, Hash
Returns an empty OptionHash or loads subcommand options yaml from disk.
Class Method Details
.parse_subcommand_options(argv) ⇒ OptionsHash, Hash
Returns an empty OptionHash or loads subcommand options yaml from disk
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/beaker/options/subcommand_options_file_parser.rb', line 8 def self.(argv) result = OptionsHash.new if Beaker::Subcommands::SubcommandUtil.execute_subcommand?(argv[0]) return result if argv[0] == 'init' if Beaker::Subcommands::SubcommandUtil::SUBCOMMAND_OPTIONS.exist? result = YAML.load_file(Beaker::Subcommands::SubcommandUtil::SUBCOMMAND_OPTIONS) end end result end |