[Groonga-commit] groonga/gcs [master] Calculate the port number based on the rule same to command line tools

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 22 10:58:04 JST 2012


YUKI Hiroshi	2012-10-22 10:58:04 +0900 (Mon, 22 Oct 2012)

  New Revision: 22c4025053e24d1af0314966e7a4f53fca59f37e
  https://github.com/groonga/gcs/commit/22c4025053e24d1af0314966e7a4f53fca59f37e

  Log:
    Calculate the port number based on the rule same to command line tools

  Modified files:
    bin/gcs
    lib/command-line.js

  Modified: bin/gcs (+3 -3)
===================================================================
--- bin/gcs    2012-10-22 10:55:28 +0900 (da6f178)
+++ bin/gcs    2012-10-22 10:58:04 +0900 (968ff7d)
@@ -21,13 +21,13 @@ commandLine
 var server = gcsServer.createServer({
       databasePath:      commandLine.options.databasePath,
       privilegedRanges:  commandLine.options.privilege,
-      port:              commandLine.options.port,
-      baseHost:          commandLine.options.baseHost,
+      port:              commandLine.port,
+      baseHost:          commandLine.baseHost,
       configurationHost: commandLine.options.configurationHost
     });
 
 server.listen(commandLine.options.port, function() {
-  console.log('gcs listening at %d', commandLine.options.port);
+  console.log('gcs listening at %d', commandLine.port);
   console.log('database is at %s', commandLine.options.databasePath);
   console.log('privileged IP ranges are %s', commandLine.options.privilege);
 });

  Modified: lib/command-line.js (+3 -0)
===================================================================
--- lib/command-line.js    2012-10-22 10:55:28 +0900 (3180498)
+++ lib/command-line.js    2012-10-22 10:58:04 +0900 (e33926f)
@@ -34,6 +34,9 @@ CommandLineInterface.prototype = {
   get port() {
     return this.options.port || Number(this.options.baseHost.split(':')[1] || 0) || defaultPort;
   },
+  get baseHost() {
+    return this.host + ':' + this.port;
+  },
 
   get options() {
     return this.program;
-------------- next part --------------
HTML����������������������������...
Download 



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