Support quantize option

This commit is contained in:
Sean Lilley 2016-06-24 14:04:12 -04:00
parent 1b78afd6eb
commit d4131a956c
2 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,7 @@ var objFile = defaultValue(argv._[0], defaultValue(argv.i, argv.input));
var outputPath = defaultValue(argv._[1], defaultValue(argv.o, argv.output));
var binary = defaultValue(defaultValue(argv.b, argv.binary), false);
var embed = defaultValue(defaultValue(argv.e, argv.embed), false);
var quantize = defaultValue(defaultValue(argv.q, argv.quantize), false); // Undocumented option
if (!defined(objFile)) {
throw new Error('-i or --input argument is required. See --help for details.');
@ -29,7 +30,8 @@ console.time('Total');
var options = {
binary : binary,
embed : embed
embed : embed,
quantize : quantize
};
convert(objFile, outputPath, options, function() {

View File

@ -12,6 +12,7 @@ module.exports = convert;
function convert(objFile, outputPath, options, done) {
var binary = defaultValue(options.binary, false);
var embed = defaultValue(options.embed, true);
var quantize = defaultValue(options.quantize, false);
if (!defined(objFile)) {
throw new Error('objFile is required');
@ -38,6 +39,7 @@ function convert(objFile, outputPath, options, done) {
var options = {
binary : binary,
embed : embed,
quantize : quantize,
createDirectory : false,
basePath : inputPath
};