Navigation Menu

Skip to content

Commit

Permalink
Show default option values
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jun 27, 2014
1 parent 4c4daea commit f4151ee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
10 changes: 10 additions & 0 deletions bin/droonga-engine-absorb-data
Expand Up @@ -20,9 +20,11 @@ require "optparse"
require "open3"

require "droonga/engine/version"
require "droonga/catalog_generator"
require "droonga/data_absorber"

options = OpenStruct.new
options.dataset = Droonga::CatalogGenerator::DEFAULT_DATASET
options.drndump = "drndump"
options.client = "droonga-request"
parser = OptionParser.new
Expand Down Expand Up @@ -87,6 +89,14 @@ end

parser.parse!(ARGV)

unless options.source_host
raise "You must specify the source host via --source-host option."
end
unless options.destination_host
raise "You must specify the destination host (this node) " +
"via --destination-host option."
end

Droonga::DataAbsorber.absorb(:drndump => options.drndump,
:client => options.client,
:dataset => options.dataset,
Expand Down
18 changes: 12 additions & 6 deletions bin/droonga-engine-catalog-generate
Expand Up @@ -42,31 +42,37 @@ parser.on("--output=PATH",
end
parser.on("--dataset=NAME",
"Add a dataset its name is NAME.",
"And set the NAME to the current dataset.") do |name|
"And set the NAME to the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_DATASET})") do |name|
current_dataset = datasets[name] = {}
end
parser.on("--n-workers=N", Integer,
"Use N workers for the current dataset.") do |n|
"Use N workers for the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_N_WORKERS})") do |n|
current_dataset[:n_workers] = n
end
parser.on("--hosts=NAME1,NAME2,...", Array,
"Use given hosts for replicas of the current dataset.") do |hosts|
"Use given hosts for replicas of the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_HOSTS.join(",")})") do |hosts|
current_dataset[:hosts] = hosts
end
parser.on("--port=PORT", Integer,
"Use the PORT as the port for the current dataset.") do |port|
"Use the PORT as the port for the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_PORT})") do |port|
current_dataset[:port] = port
end
parser.on("--tag=TAG",
"Use the TAG as the tag for the current dataset.") do |tag|
"Use the TAG as the tag for the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_TAG})") do |tag|
current_dataset[:tag] = tag
end
parser.on("--n-slices=N", Integer,
"Use N slices for each replica.") do |n|
current_dataset[:n_slices] = n
end
parser.on("--plugins=PLUGIN1,PLUGIN2,...", Array,
"Use PLUGINS for the current dataset.") do |plugins|
"Use PLUGINS for the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_PLUGINS.join(",")})") do |plugins|
current_dataset[:plugins] = plugins
end
parser.on("--schema=PATH",
Expand Down
3 changes: 2 additions & 1 deletion bin/droonga-engine-catalog-modify
Expand Up @@ -55,7 +55,8 @@ parser.on("--[no-]update",
end
parser.on("--dataset=NAME",
"Add a dataset its name is NAME.",
"And set the NAME to the current dataset.") do |name|
"And set the NAME to the current dataset.",
"(#{Droonga::CatalogGenerator::DEFAULT_DATASET})") do |name|
current_dataset = datasets[name] = {}
end
parser.on("--hosts=NAME1,NAME2,...", Array,
Expand Down

0 comments on commit f4151ee

Please sign in to comment.