~aleteoryx/tclfeed-bsky

ref: f453a88bcab5e6cac39a021958aa6f819a78dd1b tclfeed-bsky/config.tcl -rw-r--r-- 569 bytes
f453a88bAleteoryx regex tweaks 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