lib/plugin_manager.rb
def extend_option_parser opt_parser, argument_groups: nil
    result = {}
    @plugins.each do |plugin_name, plugin|
      plugin_name = ( @scope ) ? plugin_name.sub(@scope + '::', '') : plugin_name
      opt_token = ( plugin::OPT_TOKEN ) ? plugin::OPT_TOKEN : plugin_name

      plugin.arguments(groups: argument_groups).each do |argument|
        settings = ( argument[:settings].nil? ) ? {} : argument[:settings]
        settings[:default] = argument[:default]

        add_argument result, opt_parser, opt_token, plugin_name, argument
      end
    end
    result
  end
# extend option parser object with arguments from plugins
#
# @param opt_parser [OptionParser] option parser object to extend
# @param argument_groups [Array] argument groups to extend option parser with
# @return [Hash] passed command line arguments with provided values
extend option parser object with arguments from plugins
extend option parser object with arguments from plugins
def extend_option_parser opt_parser, argument_groups: nil
    result = {}
    @plugins.each do |plugin_name, plugin|
      plugin_name = ( @scope ) ? plugin_name.sub(@scope + '::', '') : plugin_name
      opt_token = ( plugin::OPT_TOKEN ) ? plugin::OPT_TOKEN : plugin_name
      plugin.arguments(groups: argument_groups).each do |argument|
        settings = ( argument[:settings].nil? ) ? {} : argument[:settings]
        settings[:default] = argument[:default]
        add_argument result, opt_parser, opt_token, plugin_name, argument
      end
    end
    result
  end
def extend_option_parser opt_parser , argument_groups : nil result = { } @plugins . each do | plugin_name , plugin | plugin_name = ( @scope ) ? plugin_name . sub ( @scope + '::' , '' ) : plugin_name opt_token = ( plugin :: OPT_TOKEN ) ? plugin :: OPT_TOKEN : plugin_name plugin . arguments ( groups : argument_groups ) . each do | argument | settings = ( argument [ :settings ] . nil? ) ? { } : argument [ :settings ] settings [ :default ] = argument [ :default ] add_argument result , opt_parser , opt_token , plugin_name , argument end end result end
extend option parser object with arguments from plugins
extend option parser object with arguments from plugins
passed command line arguments with provided values
passed command line arguments with provided values
Hash
opt_parser
option parser object to extend
option parser object to extend
argument_groups
argument groups to extend option parser with
argument groups to extend option parser with