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