import version import server/forkserver import config/chapath from std/os import getEnv, putEnv, commandLineParams, getCurrentDir from types/opt import get putEnv("CHA_LIBEXEC_DIR", ChaPath"${%CHA_LIBEXEC_DIR}".unquote().get) let forks = newForkServer() import std/options import config/config import io/serversocket import js/javascript import local/client import local/term import utils/strwidth import utils/twtstr import chagashi/charset proc main() = let params = commandLineParams() proc version(long: static bool = false): string = result = "Chawan browser v0.1 " when defined(debug): result &= "(debug)" else: result &= "(release)" proc help(i: int) = let s = version() & """ Usage: cha [options] [URL(s) or file(s)...] Options: -- Interpret all following arguments as URLs -c, --css Pass stylesheet (e.g. -c 'a{color: blue}') -d, --dump Print page to stdout -h, --help Print this usage message -o, --opt Pass config options (e.g. -o 'page.q="quit()"') -r, --run