Skip to content

Commit

Permalink
added --version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mcandre committed Feb 14, 2013
1 parent 21a9f86 commit e5fcf23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/db-migrate
Expand Up @@ -45,11 +45,20 @@ var argv = optimist
.alias('h', '?') .alias('h', '?')
.boolean('h') .boolean('h')


.describe('version', 'Print version info.')
.alias('i', 'version')
.boolean('version')

.describe('config', 'Location of the database.json file.') .describe('config', 'Location of the database.json file.')
.string('config') .string('config')


.argv; .argv;


if (argv.version) {
console.log(index.version);
process.exit(0);
}

if (argv.help || argv._.length == 0) { if (argv.help || argv._.length == 0) {
optimist.showHelp(); optimist.showHelp();
process.exit(1); process.exit(1);
Expand Down
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -18,3 +18,6 @@ exports.createMigration = function(title, migrationsDir, callback) {
callback(null, migration); callback(null, migration);
}); });
}; };

// Must be manually synced with that of package.json.
exports.version = '0.3.2';

0 comments on commit e5fcf23

Please sign in to comment.