about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-06-07 21:53:09 +0200
committerbptato <nincsnevem662@gmail.com>2022-06-07 21:56:17 +0200
commit956c5c43fe09e7d402edc9dd951891a40ae80221 (patch)
tree39c196eac75963bbdabe7126c3f4b45828996f33 /src/config
parent616e60b76ccd91ee190114cba3cd2faa4f882448 (diff)
downloadchawan-956c5c43fe09e7d402edc9dd951891a40ae80221.tar.gz
Add curl support
This calls the curl binary, not libcurl.
Diffstat (limited to 'src/config')
-rw-r--r--src/config/config.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config/config.nim b/src/config/config.nim
index 43e661c3..543236cf 100644
--- a/src/config/config.nim
+++ b/src/config/config.nim
@@ -41,6 +41,8 @@ type
     lemap*: ActionMap
     stylesheet*: string
     ambiguous_double*: bool
+    use_curl*: bool
+    curl_binary*: string
 
 func getRealKey(key: string): string =
   var realk: string
@@ -150,6 +152,13 @@ proc parseConfig(config: var Config, dir: string, t: TomlValue) =
       else: discard
     if "inline" in css:
       config.stylesheet &= css["inline"].s
+  if "network" in t:
+    let network = t["network"]
+    if "use-curl" in network:
+      let usecurl = network["use-curl"]
+      if usecurl.b:
+        config.use_curl = true
+        config.curl_binary = network["curl-binary"].s
 
 proc parseConfig(config: var Config, dir: string, stream: Stream) =
   config.parseConfig(dir, parseToml(stream))