-- main.lua — entry point -- Phase 0: arg parsing, config load, REPL start. -- See docs/PHASE0.md §4, §10. local function load_config() -- Resolution order per PHASE0.md §10: -- 1. --config 2. $AISH_CONFIG -- 3. ~/.config/aish/config.lua 4. ./config.lua -- Phase 0 stub: pick the first existing path; no CLI parsing yet. local home = os.getenv("HOME") or "" local candidates = { os.getenv("AISH_CONFIG"), home .. "/.config/aish/config.lua", "./config.lua", } for _, path in ipairs(candidates) do if path then local f = io.open(path, "r") if f then f:close(); return dofile(path), path end end end error("aish: no config.lua found in any standard location") end local function main() local config, config_path = load_config() io.stderr:write(("aish: loaded config from %s\n"):format(config_path)) local repl = require("repl") repl.run(config) end main()