2022-01-09 09:29:11 +01:00
|
|
|
module main
|
|
|
|
|
|
|
|
import os
|
2022-02-21 20:51:41 +01:00
|
|
|
import server
|
2022-04-06 16:52:31 +02:00
|
|
|
import cli
|
2022-06-14 20:38:20 +02:00
|
|
|
import console.targets
|
2022-05-07 21:50:20 +02:00
|
|
|
import console.logs
|
2022-05-26 09:15:49 +02:00
|
|
|
import console.schedule
|
2022-06-01 13:59:52 +02:00
|
|
|
import console.man
|
2022-06-22 16:19:07 +02:00
|
|
|
import console.aur
|
2022-04-09 09:46:07 +02:00
|
|
|
import cron
|
2022-12-06 13:50:25 +01:00
|
|
|
import agent
|
2022-01-09 10:36:02 +01:00
|
|
|
|
2022-01-13 19:20:14 +01:00
|
|
|
fn main() {
|
2022-12-16 11:37:51 +01:00
|
|
|
// Stop buffering output so logs always show up immediately
|
|
|
|
unsafe {
|
|
|
|
C.setbuf(C.stdout, 0)
|
|
|
|
}
|
|
|
|
|
2022-04-06 16:52:31 +02:00
|
|
|
mut app := cli.Command{
|
|
|
|
name: 'vieter'
|
2022-04-06 19:51:54 +02:00
|
|
|
description: 'Vieter is a lightweight implementation of an Arch repository server.'
|
2022-12-17 14:00:51 +01:00
|
|
|
version: '0.5.0-rc.1'
|
2022-12-21 23:42:15 +01:00
|
|
|
posix_mode: true
|
2022-04-06 16:52:31 +02:00
|
|
|
flags: [
|
|
|
|
cli.Flag{
|
|
|
|
flag: cli.FlagType.string
|
|
|
|
name: 'config-file'
|
|
|
|
abbrev: 'f'
|
|
|
|
description: 'Location of Vieter config file; defaults to ~/.vieterrc.'
|
|
|
|
global: true
|
|
|
|
default_value: [os.expand_tilde_to_home('~/.vieterrc')]
|
2022-04-06 16:57:27 +02:00
|
|
|
},
|
2022-09-11 21:50:29 +02:00
|
|
|
cli.Flag{
|
|
|
|
flag: cli.FlagType.bool
|
|
|
|
name: 'raw'
|
|
|
|
abbrev: 'r'
|
|
|
|
description: 'Only output minimal information (no formatted tables, etc.)'
|
|
|
|
global: true
|
|
|
|
},
|
2022-04-06 16:52:31 +02:00
|
|
|
]
|
|
|
|
commands: [
|
|
|
|
server.cmd(),
|
2022-06-14 20:38:20 +02:00
|
|
|
targets.cmd(),
|
2022-04-09 09:50:37 +02:00
|
|
|
cron.cmd(),
|
2022-05-07 21:50:20 +02:00
|
|
|
logs.cmd(),
|
2022-05-26 09:15:49 +02:00
|
|
|
schedule.cmd(),
|
2022-06-01 13:59:52 +02:00
|
|
|
man.cmd(),
|
2022-06-22 16:19:07 +02:00
|
|
|
aur.cmd(),
|
2022-12-06 14:11:17 +01:00
|
|
|
agent.cmd(),
|
2022-04-06 16:52:31 +02:00
|
|
|
]
|
2022-02-19 21:41:26 +01:00
|
|
|
}
|
2022-04-06 16:52:31 +02:00
|
|
|
app.setup()
|
|
|
|
app.parse(os.args)
|
2022-05-13 21:28:24 +02:00
|
|
|
return
|
2022-01-13 19:20:14 +01:00
|
|
|
}
|