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