vieter/src/server/cli.v

30 lines
569 B
Coq
Raw Normal View History

module server
import cli
import env
struct Config {
pub:
log_level string = 'WARN'
log_file string = 'vieter.log'
pkg_dir string
download_dir string
api_key string
data_dir string
repos_file 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) ? {
config_file := cmd.flags.get_string('config-file') ?
conf := env.load<Config>(config_file) ?
2022-04-06 16:57:27 +02:00
server(conf) ?
}
}
}