|
|
|
@ -285,20 +285,6 @@ __`Properties are printed line by line, in the order specified by the user. Only
|
|
|
|
|
.strict()
|
|
|
|
|
.parse();
|
|
|
|
|
|
|
|
|
|
if (!args["low-confidence"]) {
|
|
|
|
|
args["low-confidence"] = LowConfidenceMode.keep;
|
|
|
|
|
args['l'] = LowConfidenceMode.keep;
|
|
|
|
|
} else if (args["low-confidence"] == "no-op") {
|
|
|
|
|
console.error(__`Note: no-op option is deprecated, please use 'keep' instead.`);
|
|
|
|
|
args["low-confidence"] = LowConfidenceMode.keep;
|
|
|
|
|
args['l'] = LowConfidenceMode.keep;
|
|
|
|
|
} else if (!Object.values(LowConfidenceMode).includes(args["low-confidence"])) {
|
|
|
|
|
console.error(__`Unknown mode: ${args["low-confidence"]}\nPlease use one of: keep, force, exit`);
|
|
|
|
|
console.error(__`Use --help for more info.`);
|
|
|
|
|
setErrored(ExitCodes.badUsageCLI);
|
|
|
|
|
process.exit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (args["is-url"]) {
|
|
|
|
|
console.error(__`Note: --is-url option is deprecated.`);
|
|
|
|
|
}
|
|
|
|
@ -307,10 +293,6 @@ if (args["url"]) {
|
|
|
|
|
args["base"] = args["url"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (args["keep-classes"]) {
|
|
|
|
|
readabilityOptions["keepClasses"] = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function printUsage() {
|
|
|
|
|
yargs.showHelp();
|
|
|
|
@ -322,7 +304,7 @@ if (args["completion"]) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (args.version) {
|
|
|
|
|
if (args["version"]) {
|
|
|
|
|
console.log(`readability-cli v${require("./package.json").version}`);
|
|
|
|
|
console.log(`Node.js ${process.version}`);
|
|
|
|
|
return;
|
|
|
|
@ -330,6 +312,26 @@ if (args.version) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (args["keep-classes"]) {
|
|
|
|
|
readabilityOptions["keepClasses"] = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!args["low-confidence"]) {
|
|
|
|
|
args["low-confidence"] = LowConfidenceMode.keep;
|
|
|
|
|
args['l'] = LowConfidenceMode.keep;
|
|
|
|
|
} else if (args["low-confidence"] == "no-op") {
|
|
|
|
|
console.error(__`Note: no-op option is deprecated, please use 'keep' instead.`);
|
|
|
|
|
args["low-confidence"] = LowConfidenceMode.keep;
|
|
|
|
|
args['l'] = LowConfidenceMode.keep;
|
|
|
|
|
} else if (!Object.values(LowConfidenceMode).includes(args["low-confidence"])) {
|
|
|
|
|
console.error(__`Unknown mode: ${args["low-confidence"]}\nPlease use one of: keep, force, exit`);
|
|
|
|
|
console.error(__`Use --help for more info.`);
|
|
|
|
|
setErrored(ExitCodes.badUsageCLI);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let inputArg;
|
|
|
|
|
if (!args["source"]) {
|
|
|
|
|
if (process.stdin.isTTY) {
|
|
|
|
|