usage and error output

This commit is contained in:
AJ ONeal 2017-02-16 10:26:15 -07:00
parent abf11b7205
commit 6807ffed9e
1 changed files with 15 additions and 2 deletions

View File

@ -5,10 +5,20 @@
var path = require('path'); var path = require('path');
var dnsjs = require('../').DNSPacket; var dnsjs = require('../').DNSPacket;
var dirname = path.join(__dirname, 'fixtures'); //var dirname = path.join(__dirname, 'fixtures');
var expected; // shim //var expected; // shim
var onefile = process.argv[2]; var onefile = process.argv[2];
if (!onefile) {
console.error('');
console.error('Usage:');
console.error('node test/packer.js <test/fixtures/packet.type.json>');
console.error('Example:');
console.error('node test/packer.js test/fixtures/www.linode.com.a.json');
console.error('');
process.exit(1);
}
var json = JSON.parse(fs.readFileSync(onefile, 'utf8')); var json = JSON.parse(fs.readFileSync(onefile, 'utf8'));
var ab = dnsjs.write(json); var ab = dnsjs.write(json);
@ -44,5 +54,8 @@
console.log(str + '\n' + trail); console.log(str + '\n' + trail);
console.log(''); console.log('');
console.error('test implementation not complete');
process.exit(1);
}()); }());