forked from vieter-v/vieter
Merge branch 'dev' into multi-arch-repos-v2
This commit is contained in:
commit
a893577ade
15 changed files with 266 additions and 265 deletions
29
src/server/cli.v
Normal file
29
src/server/cli.v
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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
|
||||
}
|
||||
|
||||
// cmd returns the cli submodule that handles starting the server
|
||||
pub fn cmd() cli.Command {
|
||||
return cli.Command{
|
||||
name: 'server'
|
||||
description: 'Start the Vieter server.'
|
||||
execute: fn (cmd cli.Command) ? {
|
||||
config_file := cmd.flags.get_string('config-file') ?
|
||||
conf := env.load<Config>(config_file) ?
|
||||
|
||||
server(conf) ?
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue