2021-04-15 17:03:17 -07:00
|
|
|
import { Command } from 'commander';
|
2021-08-19 02:33:41 -07:00
|
|
|
import config from '@/config/index.js';
|
2019-02-03 03:10:20 -08:00
|
|
|
|
2021-04-15 17:03:17 -07:00
|
|
|
const program = new Command();
|
|
|
|
|
2021-08-19 02:33:41 -07: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 03:10:20 -08:00
|
|
|
|
2019-02-05 20:51:02 -08:00
|
|
|
if (process.env.MK_ONLY_QUEUE) program.onlyQueue = true;
|
2019-04-07 05:50:36 -07:00
|
|
|
if (process.env.NODE_ENV === 'test') program.disableClustering = true;
|
2021-08-12 03:05:07 -07:00
|
|
|
//if (process.env.NODE_ENV === 'test') program.quiet = true;
|
2019-04-07 05:50:36 -07:00
|
|
|
if (process.env.NODE_ENV === 'test') program.noDaemons = true;
|
2019-02-05 20:51:02 -08:00
|
|
|
|
2019-02-03 03:10:20 -08:00
|
|
|
export { program };
|