How to use the error function from cli
Find comprehensive JavaScript cli.error code examples handpicked from public code repositorys.
GitHub: icecrime/docker-mon
34 35 36 37 38 39 40 41 42 43
return func(cli.args); } utils.GetAllContainers(host, function (err, containers){ if (err) { return cli.error(err); } return func(containers); });
37
780
38
+ 11 other calls in file
61 62 63 64 65 66 67 68 69 70
if (cli.options.pattern) { let fileName = path.resolve(cli.options.cwd, parseFilePattern(cli.options.pattern, file, cli.options.cwd)) if (cli.options.rename === true) { fs.rename(file, fileName, function(err) { if (err) return cli.error(err) fs.writeFile(fileName, result, function(err) { if (err) return cli.error(err) cli.ok(file + ' successfully converted and renamed')
11
52
4
+ 19 other calls in file
GitHub: rt2zz/env-to-json
12 13 14 15 16 17 18 19 20 21
app.parse(process.argv) // Error check for bad commands const commandExists = app.commands.some(cmd => cmd._name == app.args[0]) if (app.args[0] && !commandExists) { cli.error('That\'s not a command!') app.outputHelp() } // Setup notifier for updates
1
3
3
GitHub: mlndz28/mysql-rest-api
15 16 17 18 19 20 21 22 23 24
process.on('uncaughtException', function (err) { if (err) { switch (err.code) { case 'EADDRINUSE': cli.error('The port is already taken.') break default: cli.error(err) }
6
1
1
+ 31 other calls in file
GitHub: Pross/img.bi
24 25 26 27 28 29 30 31 32 33
} } app(config, function(err, info, ok) { if (err) { cli.error(err); } else if (info) { cli.info(info); } else if (ok) { cli.ok(ok);
34
0
2
GitHub: alivesay/ansi-blit
19 20 21 22 23 24 25 26 27 28
}); cli.main(function main (args, options) { if (args.length === 0) { cli.error('missing FILENAME'); cli.getUsage(); } AnsiBlit.blit(args[0], options, function (err) {
0
15
2
+ 3 other calls in file
9 10 11 12 13 14 15 16 17
+ " --execute \"" + sql + "\""; exec(cmd, function (error, stdout, stderr) { if (error !== null) { cli.error('Error when executing:\n' + cmd + '\n' + error); } callback(stdout, error); });
0
7
4
+ 29 other calls in file
GitHub: deadratfink/pkg2md
108 109 110 111 112 113 114 115 116 117
return pkgToMd.writeMarkdown(options) .then(function (msg) { cli.info(msg); }) .catch(function (err) { cli.error('////////////////////////////////////////////////////////////////////////////////'); cli.error(err.stack); cli.error('////////////////////////////////////////////////////////////////////////////////'); cli.getUsage(1); });
0
2
2
+ 11 other calls in file
GitHub: genintho/html-minifier
179 180 181 182 183 184 185 186 187 188
process.stdout.write(minified); } } catch (e) { status = 4; cli.error('Cannot write to output'); } } cli.exit(status);
601
0
2
+ 7 other calls in file
18 19 20 21 22 23 24 25 26 27
, to = options.to , dry = options.dry ; if (!to || !from) { cli.error('"to" and "from" options are required.\n'); cli.output(cli.getUsage()); cli.exit(1); return ; }
180
0
11
+ 3 other calls in file
GitHub: rutaihwa/babu
90 91 92 93 94 95 96 97 98 99
// cd into <myApp> // Update package.json // npm install if (args.length !== 1) { return Cli.error('Invalid number of arguments' + '\n' + 'Usage: babu <myApp>'); } var Generate = function () {
0
2
3
+ 3 other calls in file
69 70 71 72 73 74 75 76 77
break; case 'remove': doRemove(cli, options, args); break; default: cli.error("Sorry, not implemented yet."); break; } });
0
0
12
+ 7 other calls in file
GitHub: zachary95/brozer-api
8 9 10 11 12 13 14 15 16 17
mongoose.connection.on('connected', function () { cli.ok('Mongoose default connection open to ' + dbURI); }); mongoose.connection.on('error',function (err) { cli.error('Mongoose default connection error: ' + err); }); process.on('SIGINT', function() { mongoose.connection.close(function () {
0
0
4
GitHub: gdborton/stackato
26 27 28 29 30 31 32 33 34 35
request(requestOptions, function (err, data, body) { if (err) { throw err; } if (data.statusCode !== 200) { cli.error('Login Required'); cli.error('Please use \'stackato login\''); } else { var apps = JSON.parse(body); if (apps.length > 0) { console.log(formatApps(JSON.parse(body)));
0
0
2
+ 7 other calls in file