Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.action( (env, options) => {
let config = readConfig(prog.config);
let actions = new BaseAction(config);
actions.init();
});
/*
// handling undefined command
prog.command('*')
.action(function(env){
console.log('deploying "%s"', env);
});
*/
prog.on('--help', function(){
/*
console.log(' Examples:');
console.log('');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
console.log('');
*/
});
prog.parse(process.argv);
// vim:sw=2:ts=2:sts=2:et:filetype=typescript:
'--log-level ',
'set the log level, either "0" (no output), "1" (errors), "2" (warnings + errors) or "3" (all).',
/^([0-3])$/
)
.option('--cache-dir
.option('-c, --credentials ', 'Profile name from ~/.aws/credentials ini.')
.option('-i, --interleaved', 'Interleave the log results. (auto on if using -f).')
.option('-f, --follow', 'When at the end of the logstream, ' +
'poll for more messages.')
.option('-p, --pattern
importCmsBlocksPromise().then(() => {
console.log('Done! Bye Bye!')
process.exit(0)
})
})
})
})
})
})
})
})
})
})
});
program
.on('command:*', () => {
console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' '));
process.exit(1);
});
program
.parse(process.argv)
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise ', p, ' reason: ', reason)
})
process.on('uncaughtException', (exception) => {
console.log(exception)
})
var desc = [];
if (option.deprecated) desc.push("[DEPRECATED] " + option.deprecated);
if (option.description) desc.push(option.description);
commander.option(arg, desc.join(" "));
});
commander.option("-x, --extensions [extensions]", "List of extensions to compile when a directory has been input [.es6,.js,.es,.jsx]");
commander.option("-w, --watch", "Recompile files on changes");
commander.option("-o, --out-file [out]", "Compile all input files into a single file");
commander.option("-d, --out-dir [out]", "Compile an input directory of modules into an output directory");
commander.option("-D, --copy-files", "When compiling a directory copy over non-compilable files");
commander.option("-q, --quiet", "Don't log anything");
commander.on("--help", function () {
var outKeys = function outKeys(title, obj) {
console.log(" " + title + ":");
console.log();
each(keys(obj).sort(), function (key) {
if (key[0] === "_") return;
if (obj[key].metadata && obj[key].metadata.optional) key = "[" + key + "]";
console.log(" - " + key);
});
console.log();
};
outKeys("Transformers", transform.pipeline.transformers);
import commander from 'commander';
import { version } from '../version';
import Generate from '../sub-commands/generate';
import minimist from 'minimist';
const subCommand = new Generate();
commander.on('--help', () => {
subCommand.printUserHelp();
});
commander
.version(version())
.arguments(' [entity name]')
.option('-v, --verbose', 'Turn debug mode on')
.option('-d, --dry-run', 'Do not generate files and show what files will be created')
.description('generates code based off a blueprint')
.action((blueprintName, entityName, command) => {
const debug = command.verbose;
const dryRun = command.dryRun;
const rawArgs = command.rawArgs;
const options = minimist(rawArgs.slice(2));
const cliArgs = {
initializeLogging.parentPid = parentPid;
daemon(parentPid, pathToLogFile);
});
program
.command('cachepath')
.description('show path to cache file')
.action(() => {
stdoutWrite(new Configuration('importjs').get('cacheLocation'));
});
program.command('logpath').description('show path to log file').action(() => {
stdoutWrite(pathToLogFile);
});
program.on('--help', () => {
const examples = [
'word someModule path/to/file.js',
'search someModule* path/to/file.js',
'fix path/to/file.js',
'rewrite --overwrite path/to/file.js',
'add \'{ "foo": "path/to/foo", "bar": "path/to/bar" }\' path/to/file.js',
'goto someModule path/to/file.js',
'cachepath',
'logpath',
'start --parent-pid=12345',
];
stdoutWrite(' Examples:');
stdoutWrite('');
examples.forEach((example: string) => {
stdoutWrite(` $ importjs ${example}`);
process.env.BW_PRETTY = 'true';
});
program.on('option:raw', () => {
process.env.BW_RAW = 'true';
});
program.on('option:quiet', () => {
process.env.BW_QUIET = 'true';
});
program.on('option:response', () => {
process.env.BW_RESPONSE = 'true';
});
program.on('command:*', () => {
writeLn(chalk.redBright('Invalid command: ' + program.args.join(' ')), false, true);
writeLn('See --help for a list of available commands.', true, true);
process.exitCode = 1;
});
program.on('--help', () => {
writeLn('\n Examples:');
writeLn('');
writeLn(' bwdc login');
writeLn(' bwdc test');
writeLn(' bwdc sync');
writeLn(' bwdc last-sync');
writeLn(' bwdc config server https://bw.company.com');
writeLn(' bwdc update');
writeLn('', true);
});
OSTBase = require('@ostdotcom/base'),
coreConstants = require(rootPrefix + '/config/coreConstants'),
logger = require(rootPrefix + '/lib/logger/customConsoleLogger'),
responseHelper = require(rootPrefix + '/lib/formatter/response'),
errorConfig = basicHelper.getErrorConfig();
const InstanceComposer = OSTBase.InstanceComposer;
require(rootPrefix + '/app/services/home/GlobalAggregator');
program
.option('--chainId ', 'Chain id')
.option('--configFile ', 'OST View config strategy absolute file path')
.parse(process.argv);
program.on('--help', function() {
logger.log('');
logger.log(' Example:');
logger.log('');
logger.log(" node executables/GlobalAggregatorCron.js --configFile './config.json'");
logger.log('');
logger.log('');
});
class GlobalAggregator {
constructor(params) {
const oThis = this;
oThis.config = require(params.configFile);
}
/**
* Main performer method for the class.
.option('stop', "Disbles the black list.")
.option('add [domain]', "Adds the domain to the black list.")
.option('remove [index|domain]', ["Removes one the domain at the given index. ",
"If no parameter is passed, displays the blacklist ",
"and prompts for one."].join())
.option('list', 'Displays the blacklist.');
program.on('stop', function() {
var error, msg = self.stop();
if (!(error = parseError(msg))) {
self.writeHosts();
}
puts(error || msg);
});
program.on('start', function() {
var error, msg = self.start();
if (!(error = parseError(msg))) {
self.writeHosts();
}
puts(error || msg);
});
program.on('status', function() {
if (self.list.length === 0) {
puts('The blacklist is empty.');
} else if (self.enabled()) {
puts('Workmode is enabled.');
} else {
puts('Workmode is disabled.');
}
});