Method: Morpheus::Cli::LibraryOptionListsCommand#get

Defined in:
lib/morpheus/cli/commands/library_option_lists_command.rb

#get(args) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/morpheus/cli/commands/library_option_lists_command.rb', line 95

def get(args)
  options = {}
  optparse = Morpheus::Cli::OptionParser.new do |opts|
    opts.banner = subcommand_usage("[name]")
    build_standard_get_options(opts, options)
    opts.on(nil,'--items', "Load and display option list items") do |val|
      options[:list_items] = true
    end
    opts.footer = "Get details about an option list.\n" + 
                  "[name] is required. This is the name or id of an option list. Supports 1-N [name] arguments."
  end
  optparse.parse!(args)
  if args.count < 1
    raise_command_error "wrong number of arguments, expected 1-N and got (#{args.count}) #{args.join(', ')}\n#{optparse}"
  end
  connect(options)
  id_list = parse_id_list(args)
  return run_command_for_each_arg(id_list) do |arg|
    _get(arg, options)
  end
end