~aleteoryx/tclfeed-bsky

ref: e5aec4d82ae051b61acc801add365b108b6d51d5 tclfeed-bsky/src/config.tcl -rw-r--r-- 569 bytes
e5aec4d8Aleteoryx multiple algos, file reorg 30 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if {$argc != 1} {
  puts stderr "Usage: $argv0 </path/to/config/file.ini>"
  exit -1
}
if [catch {set config [::ini::open [lindex $argv 0]]} result] {
  puts stderr "Couldn't open config: $result"
  exit -1
}

namespace eval ::config {
  proc require {config section key} {
    if ![ini::exists $config $section $key] {
      puts stderr "Missing [$section/$key] in config!"
      exit -2
    }
  }
  proc check {config} {
    require $config database path
    require $config database max_posts

    require $config atproto jetstream_host
  }
}

config::check $config