2021-04-16 09:03:17 +09:00
|
|
|
import { Command } from 'commander';
|
2021-08-19 18:33:41 +09:00
|
|
|
import config from '@/config/index.js';
|
2019-02-03 20:10:20 +09:00
|
|
|
|
2021-04-16 09:03:17 +09:00
|
|
|
const program = new Command();
|
|
|
|
|
2021-08-19 18:33:41 +09:00
|
|
|
program.version(config.version);
|
|
|
|
program.option('--no-daemons', 'Disable daemon processes (for debbuging)');
|
|
|
|
program.option('--disable-clustering', 'Disable clustering');
|
|
|
|
program.option('--only-server', 'Run server only (without job queue processing)');
|
|
|
|
program.option('--only-queue', 'Pocessing job queue only (without server)');
|
|
|
|
program.option('--quiet', 'Suppress all logs');
|
|
|
|
program.option('--verbose', 'Enable all logs');
|
|
|
|
program.option('--with-log-time', 'Include timestamp for each logs');
|
|
|
|
program.option('--slow', 'Delay all requests (for debbuging)');
|
|
|
|
program.option('--color', 'This option is a dummy for some external program\'s (e.g. forever) issue.');
|
|
|
|
program.parse(process.argv);
|
2019-02-03 20:10:20 +09:00
|
|
|
|
2019-02-06 13:51:02 +09:00
|
|
|
if (process.env.MK_ONLY_QUEUE) program.onlyQueue = true;
|
2019-04-07 21:50:36 +09:00
|
|
|
if (process.env.NODE_ENV === 'test') program.disableClustering = true;
|
2021-08-12 19:05:07 +09:00
|
|
|
//if (process.env.NODE_ENV === 'test') program.quiet = true;
|
2019-04-07 21:50:36 +09:00
|
|
|
if (process.env.NODE_ENV === 'test') program.noDaemons = true;
|
2019-02-06 13:51:02 +09:00
|
|
|
|
2019-02-03 20:10:20 +09:00
|
|
|
export { program };
|