[Groonga-commit] droonga/droonga-engine at 50f5695 [master] Add "--update" option to overwrite the soruce

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jun 27 21:47:08 JST 2014


YUKI Hiroshi	2014-06-27 21:47:08 +0900 (Fri, 27 Jun 2014)

  New Revision: 50f5695e1f8d22c658cdafc264db3385fb837b3f
  https://github.com/droonga/droonga-engine/commit/50f5695e1f8d22c658cdafc264db3385fb837b3f

  Message:
    Add "--update" option to overwrite the soruce

  Modified files:
    bin/droonga-engine-modify-catalog

  Modified: bin/droonga-engine-modify-catalog (+9 -0)
===================================================================
--- bin/droonga-engine-modify-catalog    2014-06-27 21:41:29 +0900 (0c7e213)
+++ bin/droonga-engine-modify-catalog    2014-06-27 21:47:08 +0900 (3ff9bb3)
@@ -34,6 +34,7 @@ datasets = {
 options = OpenStruct.new
 options.source_path = "./catalog.json"
 options.output_path = "-"
+options.update      = false
 parser = OptionParser.new
 parser.version = Droonga::Engine::VERSION
 parser.on("--source=PATH",
@@ -48,6 +49,11 @@ parser.on("--output=PATH",
           "(#{options.output_path})") do |path|
   options.output_path = path
 end
+parser.on("--[no-]update",
+          "Update the source file itself, or not.",
+          "(#{options.update})") do |update|
+  options.update = update
+end
 parser.on("--dataset=NAME",
           "Add a dataset its name is NAME.",
           "And set the NAME to the current dataset.") do |name|
@@ -63,6 +69,9 @@ parser.on("--remove-replica-hosts=NAME1,NAME2,...", Array,
 end
 parser.parse!(ARGV)
 
+if options.source_path != "-" and options.update
+  options.output_path = options.source_path
+end
 
 def load_source(path)
   source = nil
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index