Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (command === 'help') {
usage();
process.exit(0);
}
if (!connString)
{
if (!parsed.raw) {
inputError('Missing connection string');
usage();
}
process.exit(1);
}
var registry = new Registry(connString, new Https());
if (command === 'list') {
registry.list(function (err, res, list) {
if (err) serviceError(err);
else {
list.forEach(function (device) {
printDevice(device);
});
}
});
}
else if (command === 'create') {
if (!arg) inputError('No device information given');
var info;
try {
// 'create' command expects either deviceId or JSON device description