|
|
@ -12,12 +12,13 @@ program.on('--help', () => { |
|
|
|
|
|
|
|
|
|
|
|
program |
|
|
|
program |
|
|
|
.version('0.2.5') |
|
|
|
.version('0.2.5') |
|
|
|
.option('-h, --host <n>', 'hostname') |
|
|
|
.option('-h, --host <n>', 'hostname / localhost by default') |
|
|
|
.option('-d, --database <n>', 'database schema name') |
|
|
|
|
|
|
|
.option('-u, --user <n>', 'username of database / root by default') |
|
|
|
.option('-u, --user <n>', 'username of database / root by default') |
|
|
|
.option('-p, --password <n>', 'password of database / empty by default') |
|
|
|
.option('-p, --password <n>', 'password of database / empty by default') |
|
|
|
.option('-n, --portNumber <n>', 'port number / 3000 by default') |
|
|
|
.option('-d, --database <n>', 'database schema name') |
|
|
|
|
|
|
|
.option('-n, --portNumber <n>', 'port number for app / 3000 by default') |
|
|
|
.option('-s, --storageFolder <n>', 'storage folder / current working dir by default / available only with local') |
|
|
|
.option('-s, --storageFolder <n>', 'storage folder / current working dir by default / available only with local') |
|
|
|
|
|
|
|
.option('-i, --ignoreTables <n>', 'comma separated table names to ignore',list) |
|
|
|
.parse(process.argv) |
|
|
|
.parse(process.argv) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -52,6 +53,14 @@ exports.handle = program => { |
|
|
|
program.host = program.host || 'localhost'; |
|
|
|
program.host = program.host || 'localhost'; |
|
|
|
program.storageFolder = program.storageFolder || process.cwd() |
|
|
|
program.storageFolder = program.storageFolder || process.cwd() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (program.ignoreTables) { |
|
|
|
|
|
|
|
let ignoreTables = program.ignoreTables.split(',') |
|
|
|
|
|
|
|
program.ignoreTables = {} |
|
|
|
|
|
|
|
for (var i = 0; i < ignoreTables.length; ++i) { |
|
|
|
|
|
|
|
program.ignoreTables[ignoreTables[i]] = ignoreTables[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
program.connectionLimit = 10; |
|
|
|
program.connectionLimit = 10; |
|
|
|
|
|
|
|
|
|
|
|
if (program.host === 'localhost' || program.host === '127.0.0.1' || program.host === '::1') { |
|
|
|
if (program.host === 'localhost' || program.host === '127.0.0.1' || program.host === '::1') { |
|
|
|