npm-swipl-wasm icon indicating copy to clipboard operation
npm-swipl-wasm copied to clipboard

Is there a Command Line Interface (CLI) ?

Open Jean-Luc-Picard-2021 opened this issue 1 year ago • 0 comments

The following question, whether there is a swipl.js that provides a command line interface (CLI) has not yet been resolved. node is the nodeJS interpreter, and swipl.js is the SWI-Prolog CLI driver:

node swipl.js <Prolog Text> <Argument1> .. <Argumentn>

Creating a separate ticket with this feature request and/or clarification focus only, to not pollute another ticket which reported another issue. Mostlikely it will use process.argv somewhere. To grab the command

line arguments. Or some library that does that for you. So hardcoding main() isn't a solution, because it lacks the parameter passing. Also traditionally the argv should land in the Prolog flag argv, which

exists in SWI-Prolog. The polluted ticket was this here:

Audit failed, problems with node-static https://github.com/SWI-Prolog/npm-swipl-wasm/issues/431

Jean-Luc-Picard-2021 avatar Dec 06 '23 08:12 Jean-Luc-Picard-2021