cmdline-args

How to pass command line arguments to Deno?

让人想犯罪 __ 提交于 2020-06-27 18:26:46
问题 I have a Deno app, that I wish to pass some command line args to. I searched the manual, but found nothing. I tried to use the same commands used in Node.js, assuming they might be sharing some for the std libraries, but it didn't work as well. var args = process.argv.slice(2); // Uncaught ReferenceError: process is not defined Any suggestions? 回答1: You can use Deno.args to access the command line arguments in Deno. To try it create a file test.ts : console.log(Deno.args); And run it with

Lua cmd-line string

試著忘記壹切 提交于 2019-12-23 19:21:47
问题 Say I call Lua with this cmd: luajit neuralnetwork.lua --satEpoch "somestring" --maxEpoch 50 How can I access this same cmd-line string from Lua? I know about the arg table, but it removes all quotes from the original command string making it difficult to reconstruct: { "--maxEpoch" "--satEpoch" "50" "somestring" [-1] : "luajit" [0] : "examples/neuralnetwork.lua" } If I can save the exact string to a file from within Lua, I can easily call it again later. 回答1: @peterpi is correct that the