1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Readme cleanup

This commit is contained in:
Étienne Fildadut 2019-08-24 15:19:59 +02:00
parent da4ee63f3f
commit d410606dc0
3 changed files with 80 additions and 68 deletions

View file

@ -7,7 +7,10 @@ local args = cmdline(arg)
if args.help or args.h then
print("Candran "..candran.VERSION.." interpreter by Reuh")
print("Usage: "..arg[0].." [options] filename")
print("Specify no options to start the REPL.")
print("Use - instead of a filename to read from the standard input.")
print("Interpreter options:")
print(" -help or -h print this text")
print("Default options:")
for opt, val in pairs(candran.default) do
if type(val) == "string" then val = val:gsub("\n", "\\n") end

View file

@ -4,7 +4,9 @@ local cmdline = require("lib.cmdline")
local parse = require("lib.lua-parser.parser").parse
local pp = require("lib.lua-parser.pp")
if #arg < 1 then
local args = cmdline(arg)
if #arg < 1 or args.help or args.h then
print("Candran "..candran.VERSION.." compiler by Reuh")
print("Usage: "..arg[0].." [options] filenames...")
print("Use - instead of filenames to read from the standard input. The output file will be named stdin.lua by default.")
@ -16,6 +18,7 @@ if #arg < 1 then
print(" -compile only run the compiler")
print(" -parse only parse the file and prints errors to stdout")
print(" -ast (for debugging purposes) only parse the files and dump the AST to stdout")
print(" -help or -h print this text")
print("Default options:")
for opt, val in pairs(candran.default) do
if type(val) == "string" then val = val:gsub("\n", "\\n") end
@ -24,8 +27,6 @@ if #arg < 1 then
return
end
local args = cmdline(arg)
if arg[#arg] == "-" then
table.insert(args, io.stdin)
end