Sha256: 35ffd1f1349f0934f8a0a3e07d1bf4e9389b987a7e6285737221301f97a7418f

Contents?: true

Size: 667 Bytes

Versions: 5

Compression:

Stored size: 667 Bytes

Contents

module Beaker
  module Options
    #A set of functions to read options files
    module SubcommandOptionsParser

      # @return [OptionsHash, Hash] returns an empty OptionHash or loads subcommand options yaml
      #   from disk
      def self.parse_subcommand_options(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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
beaker-3.18.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-3.17.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-3.16.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-3.15.0 lib/beaker/options/subcommand_options_file_parser.rb
beaker-3.14.0 lib/beaker/options/subcommand_options_file_parser.rb