45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
/**
|
|
* XMQL Document Helper CLI Tools ...
|
|
* a module for handle MQL5 Documents Generating ...
|
|
*
|
|
* Maintainer
|
|
*
|
|
* Hadi Khazaee Asl <https://saherelm.ir> (hadi_khazaee_asl@yahoo.com)
|
|
*/
|
|
|
|
//
|
|
// Import Requirements ...
|
|
const XColorTools = require("./x-color.tools");
|
|
const XDocumentTools = require("./x-mql-document.tools");
|
|
|
|
const args = process.argv.slice(2);
|
|
if (args.length < 1) {
|
|
//
|
|
// Log ...
|
|
console.log(
|
|
XColorTools.applyForegroundColor(
|
|
"Invalid Usage Command ...",
|
|
XColorTools.COLOR_NAMES.Red
|
|
)
|
|
);
|
|
console.log(
|
|
XColorTools.applyForegroundColor(
|
|
"Usage: node mql5-doc-extractor.js <path_to_mql5_file> [output_md_file]",
|
|
XColorTools.COLOR_NAMES.Yellow
|
|
)
|
|
);
|
|
console.log(
|
|
XColorTools.applyForegroundColor(
|
|
"Example: node mqlDocumentHelper.js ./MyEA.mq5 ./docs/MyEA.md",
|
|
XColorTools.COLOR_NAMES.LightBlue
|
|
)
|
|
);
|
|
|
|
//
|
|
process.exit(1);
|
|
}
|
|
|
|
const inputFile = args[0];
|
|
const outputFile = args[1] || inputFile.replace(/\.(mq5|mqh)$/i, '_DOCS.md');
|
|
|
|
XDocumentTools.extractMQL5Documentation(inputFile, outputFile); |