Report supported options upon invalid option syntax.
fixes #1883
}
}));
} catch(ex) {
- fatal("Error parsing arguments for '" + flag + "': " + value);
+ options[value] = null;
}
return options;
}
done();
});
});
+ it("Should print supported options on invalid option syntax", function(done) {
+ var command = uglifyjscmd + " test/input/comments/filter.js -b ascii-only";
+ exec(command, function (err, stdout, stderr) {
+ assert.ok(err);
+ assert.strictEqual(stdout, "");
+ assert.ok(/^Supported options:\n\{[^}]+}\nERROR: `ascii-only` is not a supported option/.test(stderr), stderr);
+ done();
+ });
+ });
});