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