aboutsummaryrefslogtreecommitdiff
path: root/src/js/extract_lsp.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/extract_lsp.js')
-rw-r--r--src/js/extract_lsp.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js/extract_lsp.js b/src/js/extract_lsp.js
index 6f53ebc..358d404 100644
--- a/src/js/extract_lsp.js
+++ b/src/js/extract_lsp.js
@@ -3,6 +3,14 @@
// the vm needs the layout, because the server's map is not the compiler's.
const fs = require('fs');
const path = require('path');
+if (process.argv.length > 2) {
+ if (process.argv.length === 3 && ['--help', '-h'].includes(process.argv[2])) {
+ console.log('usage: node src/js/extract_lsp.js [--help|-h]\nconverts build/lsp/genome.h and its memory map into src/js/lsp.json; build the lsp first.');
+ process.exit(0);
+ }
+ console.error('extract_lsp: unexpected arguments; use --help for usage');
+ process.exit(2);
+}
const root = path.join(__dirname, '..', '..');
const genome = fs.readFileSync(path.join(root, 'build', 'lsp', 'genome.h'), 'utf8');