YUKI Hiroshi
null+****@clear*****
Mon Oct 15 14:16:02 JST 2012
YUKI Hiroshi 2012-10-15 14:16:02 +0900 (Mon, 15 Oct 2012) New Revision: 72b72d0dd680798fcf208b99cb21b8fdad824bcc https://github.com/groonga/gcs/commit/72b72d0dd680798fcf208b99cb21b8fdad824bcc Log: Accept "--port" and "--base-host" as common options Modified files: bin/gcs lib/command-line.js test/gcs-commands.test.js Modified: bin/gcs (+0 -11) =================================================================== --- bin/gcs 2012-10-15 14:05:05 +0900 (fe2892d) +++ bin/gcs 2012-10-15 14:16:02 +0900 (da6f178) @@ -5,23 +5,12 @@ var CLI = require(__dirname + '/../lib/command-line').CommandLineInterface; var commandLine = new CLI(); commandLine - .option('-p, --port <port>', - 'specify port' + - '(GCS_PORT) ' + - '[' + CLI.defaultPort + ']', - Number, - CLI.defaultPort) .option('--privilege <ip range>', 'list of IP ranges for privileged client ' + '(GCS_PRIVILEGED_RANGES) ' + '[' + CLI.defaultPrivilegedRanges + ']', String, CLI.defaultPrivilegedRanges) - .option('--base-host <hostname>', - 'The base host name assigned to the service ' + - '(GCS_BASE_HOST) ' + - '[' + CLI.defaultBaseHost + ']', - String) .option('--configuration-host <hostname>', 'The host name for configuration API of the service ' + '(GCS_CONFIGURATION_HOST) ' + Modified: lib/command-line.js (+16 -2) =================================================================== --- lib/command-line.js 2012-10-15 14:05:05 +0900 (66b7fbe) +++ lib/command-line.js 2012-10-15 14:16:02 +0900 (5b5ba18) @@ -83,9 +83,23 @@ CommandLineInterface.prototype = { this.program .option('--database-path <path>', - 'database path (GCS_DATABASE_PATH) [' + defaultDatabasePath + ']', + 'database path' + + '(GCS_DATABASE_PATH) ' + + '[' + defaultDatabasePath + ']', String, - defaultDatabasePath); + defaultDatabasePath) + .option('-p, --port <port>', + 'specify port' + + '(GCS_PORT) ' + + '[' + defaultPort + ']', + Number, + defaultPort) + .option('--base-host <hostname>', + 'The base host name assigned to the service ' + + '(GCS_BASE_HOST) ' + + '[' + defaultBaseHost + ']', + String, + defaultBaseHost); this.program.parse(process.argv); Modified: test/gcs-commands.test.js (+5 -1) =================================================================== --- test/gcs-commands.test.js 2012-10-15 14:05:05 +0900 (9c4766e) +++ test/gcs-commands.test.js 2012-10-15 14:16:02 +0900 (518758b) @@ -6,13 +6,16 @@ var Domain = require('../lib/database/domain').Domain; var context; var temporaryDatabase; +var server; function commonSetup() { temporaryDatabase = utils.createTemporaryDatabase(); context = temporaryDatabase.get(); + server = utils.setupServer(context); } function commonTeardown() { + server.close(); context = undefined; temporaryDatabase.clear(); temporaryDatabase.teardown(); @@ -177,7 +180,8 @@ suite('gcs-describe-domain', function() { utils .run('gcs-describe-domain', '--domain-name', 'domain1', - '--database-path', temporaryDatabase.path) + '--port', utils.testPort, + '--base-host', 'localhost:' + utils.testPort) .next(function(result) { var domain = new Domain('domain1', context); assert.deepEqual({ code: result.code, message: result.output.stdout }, -------------- next part -------------- HTML����������������������������... Download