diff options
Diffstat (limited to 'src/main.nim')
-rw-r--r-- | src/main.nim | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.nim b/src/main.nim index 0371c801..605fba94 100644 --- a/src/main.nim +++ b/src/main.nim @@ -35,7 +35,8 @@ Options: -c, --css <stylesheet> Pass stylesheet (e.g. -c 'a{color: blue}') -o, --opt <config> Pass config options (e.g. -o 'page.q="QUIT"') -T, --type <type> Specify content mime type - -I, --input-charset <name> Specify document charset + -I, --input-charset <enc> Specify document charset + -O, --display-charset <enc> Specify display charset -M, --monochrome Set color-mode to 'monochrome' -V, --visual Visual startup mode -r, --run <script/file> Run passed script or file @@ -84,6 +85,16 @@ while i < params.len: cs = some(c) else: help(1) + of "-O", "--output-charset": + inc i + if i < params.len: + let c = getCharset(params[i]) + if c == CHARSET_UNKNOWN: + stderr.write("Unknown charset " & params[i] & "\n") + quit(1) + conf.encoding.display_charset = some(c) + else: + help(1) of "-": discard # emulate programs that accept - as stdin of "-d", "-dump", "--dump": |