Add nimble file and some makefile tasks.
FossilOrigin-Name: c4a4dfdf10b5d1e7136eea1f078ba67798a134c69436d7f9679ba93c04c9671a
This commit is contained in:
parent
0313f1681a
commit
3583868771
5 changed files with 83 additions and 62 deletions
31
src/sieb.nim
Normal file
31
src/sieb.nim
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# vim: set et nosta sw=4 ts=4 :
|
||||
|
||||
import
|
||||
std/streams,
|
||||
yaml/serialization
|
||||
|
||||
const
|
||||
VERSION = "v0.1.0"
|
||||
|
||||
type
|
||||
rule = object
|
||||
headers: seq[ tuple[ header: string, regexp: string ] ]
|
||||
deliver {.defaultVal: "Maildir"}: string
|
||||
filter {.defaultVal: ""}: string
|
||||
|
||||
# Typed configuration file layout for YAML loading.
|
||||
Config = object
|
||||
logfile {.defaultVal: "".}: string
|
||||
pre_filter {.defaultVal: @[]}: seq[string]
|
||||
post_filter {.defaultVal: @[]}: seq[string]
|
||||
rules {.defaultVal: @[]}: seq[rule]
|
||||
|
||||
|
||||
var conf: Config
|
||||
|
||||
let s = newFileStream( "config.yml" )
|
||||
load( s, conf )
|
||||
s.close
|
||||
|
||||
echo conf
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue