MCPcopy Index your code
hub / github.com/Keyang/node-csvtojson / _showHelp

Function _showHelp

bin/csvtojson.js:20–43  ·  view source on GitHub ↗
(errno)

Source from the content-addressed store, hash-verified

18 var parsedCmd;
19
20 function _showHelp(errno) {
21 var key;
22 errno = typeof errno === "number" ? errno : 0;
23 console.log("csvtojson: Convert csv to JSON format");
24 console.log("version:", pkg.version);
25 console.log("Usage: csvtojson [<command>] [<options>] filepath\n");
26 console.log("Commands: ");
27 for (key in cmds) {
28 if (cmds.hasOwnProperty(key)) {
29 console.log("\t%s: %s", key, cmds[key]);
30 }
31 }
32 console.log("Options: ");
33 for (key in opts) {
34 if (opts.hasOwnProperty(key)) {
35 console.log("\t%s: %s", key, opts[key].desc);
36 }
37 }
38 console.log("Examples: ");
39 for (var i = 0; i < exps.length; i++) {
40 console.log("\t%s", exps[i]);
41 }
42 process.exit(errno);
43 }
44 function stringToRegExp(str) {
45 var lastSlash = str.lastIndexOf("/");
46 var source = str.substr(1, lastSlash);

Callers 4

parseFunction · 0.85
runFunction · 0.85
parseBoolFunction · 0.85
commandParserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected