vieter/src/server/cli.v

28 lines
553 B
Coq
Raw Normal View History

module server
import cli
import vieter.vconf
struct Config {
pub:
log_level string = 'WARN'
pkg_dir string
data_dir string
api_key string
default_arch string
}
2022-04-06 17:57:05 +02:00
// cmd returns the cli submodule that handles starting the server
pub fn cmd() cli.Command {
return cli.Command{
name: 'server'
2022-04-06 19:51:54 +02:00
description: 'Start the Vieter server.'
execute: fn (cmd cli.Command) ? {
2022-05-14 20:06:08 +02:00
config_file := cmd.flags.get_string('config-file')?
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)?
2022-05-14 20:06:08 +02:00
server(conf)?
}
}
}