run_sample arguments

in spanner/database_leader_placement_samples.rb [209:232]


def run_sample arguments
  commands = [
    "instance_config", "list_instance_configs", "list_databases",
    "create_database_with_default_leader",
    "update_database_with_default_leader", "database_ddl",
    "query_information_schema_database_options"
  ]

  command = arguments.shift
  project_id = ENV["GOOGLE_CLOUD_PROJECT"]

  return usage unless commands.include? command

  sample_method = method command
  parameters = { project_id: project_id }

  sample_method.parameters.each do |paramater|
    next if paramater.last == :project_id
    parameters[paramater.last] = arguments.shift
  end

  sample_method.call(**parameters)
end