Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.action(function(name, options) {
let api = apis[name];
if (api === undefined) {
console.log('No API named: ' + name);
process.exit(1);
}
console.log(cliff.inspect(api));
});
delete s.buy_order
delete s.sell_order
console.log('\nmanual'.grey + ' order cancel' + ' command executed'.grey)
} else if (key === 'm' && !info.ctrl && so.mode === 'live') {
so.manual = !so.manual
console.log('\nMANUAL trade in LIVE mode: ' + (so.manual ? 'ON'.green.inverse : 'OFF'.red.inverse))
} else if (key === 'T' && !info.ctrl) {
so.order_type = 'taker'
console.log('\n' + 'Taker fees activated'.bgRed)
} else if (key === 'M' && !info.ctrl) {
so.order_type = 'maker'
console.log('\n' + 'Maker fees activated'.black.bgGreen)
} else if (key === 'o' && !info.ctrl) {
listOptions()
} else if (key === 'O' && !info.ctrl) {
console.log('\n' + cliff.inspect(so))
} else if (key === 'P' && !info.ctrl) {
console.log('\nWriting statistics...'.grey)
printTrade(false)
} else if (key === 'X' && !info.ctrl) {
console.log('\nExiting... ' + '\nWriting statistics...'.grey)
printTrade(true)
} else if (key === 'd' && !info.ctrl) {
console.log('\nDumping statistics...'.grey)
printTrade(false, true)
} else if (key === 'D' && !info.ctrl) {
console.log('\nDumping statistics...'.grey)
toggleStats()
} else if (key === 'L' && !info.ctrl) {
debug.flip()
console.log('\nDEBUG mode: ' + (debug.on ? 'ON'.green.inverse : 'OFF'.red.inverse))
} else if (info.name === 'c' && info.ctrl) {
cli.withStdinLines(function (lines) {
for (var i = 0; i < lines.length; i++) {
if (lines[i] === '') {
continue;
}
var address = new v6.Address(lines[i]);
if (options.v) {
this.output(sprintf('%s = %s\n', lines[i], cliff.inspect(address)));
} else if (options.c) {
rows.push([
lines[i],
address.isValid() ? 'Yes' : 'No'.red,
address.isValid() ? address.correctForm() : '',
address.isValid() ? address.canonicalForm() : ''
]);
} else {
this.output(sprintf('%s,%s\n', lines[i], address.isValid() ? 'valid' : 'invalid'));
}
}
if (options.c) {
console.log(cliff.stringifyRows(rows, ['green', 'green', 'green', 'green']));
}
});
app.cmd('config', cli.config = function () {
var keys = Object.keys(forever.config.store),
conf = cliff.inspect(forever.config.store);
if (keys.length <= 2) {
conf = conf.replace(/\{\s/, '{ \n')
.replace(/\}/, '\n}')
.replace('\\033[90m', ' \\033[90m')
.replace(/, /ig, ',\n ');
}
else {
conf = conf.replace(/\n\s{4}/ig, '\n ');
}
conf.split('\n').forEach(function (line) {
forever.log.data(line);
});
});
app.cmd('config', cli.config = function () {
var keys = Object.keys(forever.config.store),
conf = cliff.inspect(forever.config.store);
if (keys.length <= 2) {
conf = conf.replace(/\{\s/, '{ \n')
.replace(/\}/, '\n}')
.replace('\\033[90m', ' \\033[90m')
.replace(/, /ig, ',\n ');
}
else {
conf = conf.replace(/\n\s{4}/ig, '\n ');
}
conf.split('\n').forEach(function (line) {
forever.log.data(line);
});
});
app.cmd('config', cli.config = function () {
var keys = Object.keys(forever.config.store),
conf = cliff.inspect(forever.config.store);
if (keys.length <= 2) {
conf = conf.replace(/\{\s/, '{ \n')
.replace(/\}/, '\n}')
.replace('\\033[90m', ' \\033[90m')
.replace(/, /ig, ',\n ');
}
else {
conf = conf.replace(/\n\s{4}/ig, '\n ');
}
conf.split('\n').forEach(function (line) {
forever.log.data(line);
});
});
}, function (err: Error, data: object) {
if (err) console.log(err);
else util.log('\n' + cliff.inspect(data) + '\n');
rl.prompt();
});
}
}, function(err, data) {
if (err) console.log(err);
else util.log('\n' + cliff.inspect(data) + '\n');
rl.prompt();
});
}
var msg = data.msg;
var server = msg.body;
var rows = [];
rows.push(['time', 'serverId', 'serverType', 'pid', 'cpuAvg', 'memAvg', 'vsz', 'rss', 'usr', 'sys', 'gue']);
var color = getColor(rows[0].length);
if (server) {
rows.push([server['time'], server['serverId'], server['serverType'], server['pid'], server['cpuAvg'], server['memAvg'], server['vsz'], server['rss'], server['usr'], server['sys'], server['gue']]);
log('\n' + cliff.stringifyRows(rows, color) + '\n');
} else {
log('\n' + consts.STATUS_ERROR + '\n');
}
return;
}
if (comd === 'config' || comd === 'components' || comd === 'settings' || comd === 'get' || comd === 'set' || comd === 'exec' || comd === 'run') {
log('\n' + cliff.inspect(data) + '\n');
return;
}
if (comd === 'stop') {
return
}
if (comd === 'add') {
return
}
if (comd === 'proxy' || comd === 'handler') {
log('\n' + cliff.inspect(data) + '\n');
return
}
if (comd === 'config' || comd === 'components' || comd === 'settings' || comd === 'get' || comd === 'set' || comd === 'exec' || comd === 'run') {
log('\n' + cliff.inspect(data) + '\n');
return;
}
if (comd === 'stop') {
return;
}
if (comd === 'add') {
return;
}
if (comd === 'proxy' || comd === 'handler') {
log('\n' + cliff.inspect(data) + '\n');
return;
}
if (comd === 'memory' || comd === 'cpu') {
log(data + '\n');
return;
}
}