Added argument parsing and file reading.

pull/99/head
AaronCoplan 2017-12-14 17:00:11 -05:00
rodzic eab7422055
commit 10b0cebe31
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 2D904C521DB00D86
1 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -1,3 +1,21 @@
for(var i = 0; i < 10; ++i){
console.log("Main");
var CryptoJS = require("crypto-js");
var FileSystem = require("fs");
const argv = process.argv;
const argc = process.argv.length;
if(argc != 4){
console.log("Failure: invalid argument length!");
process.exit(1);
}
const htmlFilepath = argv[2];
const password = argv[3];
try{
var contents = FileSystem.readFileSync(htmlFilepath, 'utf8');
}catch(e){
console.log("Failure: file does not exist!");
process.exit(1);
}
console.log(contents);