objectionary / eoc

Command-line toolkit for parsing, compiling, transpiling, optimizing, linking, dataizing, and running EOLANG programs
https://www.npmjs.com/package/eolang
MIT License
17 stars 11 forks source link

error when wrong `--language` argument supplied #291

Open yegor256 opened 3 months ago

yegor256 commented 3 months ago

I'm doing this:

$ eoc -l js dataize app
/opt/homebrew/lib/node_modules/eolang/src/eoc.js:279
        .then((r) => commands[lang].transpile(program.opts()))
                                    ^

TypeError: Cannot read properties of undefined (reading 'transpile')
    at /opt/homebrew/lib/node_modules/eolang/src/eoc.js:279:37
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v21.7.1

It seems that I'm passing a wrong value to the -l flag. First, I don't know what to pass, since the eoc --help doesn't explain it. Second, when a wrong value is passed, we should print a proper error message.

yegor256 commented 3 months ago

@maxonfjvipon please, take a look