[Groonga-commit] nroonga/nroonga-httpd [master] parse commandline options at one place

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 8日 (木) 20:46:43 JST


Yoji SHIDARA	2012-03-08 20:46:43 +0900 (Thu, 08 Mar 2012)

  New Revision: 115ce02c7c7cf6f8786c2e2beca38a881d1ea3b2

  Log:
    parse commandline options at one place

  Modified files:
    lib/command.coffee

  Modified: lib/command.coffee (+5 -10)
===================================================================
--- lib/command.coffee    2012-03-08 20:45:49 +0900 (e7a4ac7)
+++ lib/command.coffee    2012-03-08 20:46:43 +0900 (7effa63)
@@ -62,9 +62,9 @@ parseOptions = (callback) ->
     callback(opt)
 
 exports.run = ->
-  if cluster.isMaster
-    parseOptions (opt) ->
-      argv = opt.argv
+  parseOptions (opt) ->
+    argv = opt.argv
+    if cluster.isMaster
       if argv.help
         opt.showHelp()
         process.exit(0)
@@ -77,14 +77,9 @@ exports.run = ->
           cluster.fork()
         cluster.on 'death', (worker) ->
           console.log "worker #{worker.pid} died"
-  else
-    parseOptions (opt) ->
-      argv = opt.argv
-
-      app = nroongaHttpd.createServer(
+    else
+      app = nroongaHttpd.createServer
         dbPath: argv._[0]
         verbose: argv.v
         documentRoot: argv['document-root']
-      )
-
       app.listen(argv.p)




Groonga-commit メーリングリストの案内
Back to archive index