-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path3.js
More file actions
29 lines (22 loc) · 663 Bytes
/
3.js
File metadata and controls
29 lines (22 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function printHelp(){
console.log("3.js (c) softhinkers.com");
console.log("");
console.log("usage:");
console.log("--help print this help");
//console.log("--name say hello to {NAME}");
console.log("--file={NAME} read the file of {NAME} and output");
console.log("");
}
var args = require("minimist")(process.argv.slice(2),{ string: "file" });
if(args.help || !args.file){
printHelp();
process.exit(1);
}
var hello = require("./helloworld3.js");
hello.say(args.file)
.val(function(contents){
console.log(contents.toString());
})
.or(function(err){
console.error("Error: "+ err);
})