import version import std/options import std/os import std/posix import bindings/termcap import chagashi/charset import config/chapath import config/config import local/client import local/term import monoucha/javascript import server/forkserver import types/opt import utils/sandbox import utils/strwidth import utils/twtstr const ChaVersionStr0 = "Chawan browser v0.1" const ChaVersionStr = block: var s = ChaVersionStr0 & " (" when defined(debug): s &= "debug" else: s &= "release" s &= ", " when SandboxMode == stNone: s &= "not sandboxed" else: s &= "sandboxed" s &= ", " when TermcapFound: s &= "has termcap" else: s &= "no termcap" s & ")\n" const ChaVersionStrLong = block: var s = ChaVersionStr0 & " (" when defined(debug): s &= "debug" else: s &= "release" s &= ", " when SandboxMode == stNone: s &= "not sandboxed" else: s &= "sandboxed by " & $SandboxMode s &= ", " when TermcapFound: s &= "termcap library " & Termlib else: s &= "no termcap" s & ")\n" proc help(i: int) = let s = ChaVersionStr & """ 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