| 1 | mod artifacts; |
| 2 | mod cli; |
| 3 | mod client; |
| 4 | mod config; |
| 5 | mod daemon; |
| 6 | mod history; |
| 7 | mod hook; |
| 8 | mod paths; |
| 9 | mod proto; |
| 10 | mod run; |
| 11 | mod sched; |
| 12 | mod store; |
| 13 | mod sys; |
| 14 | #[cfg(target_os = "linux")] |
| 15 | mod systemd; |
| 16 | mod units; |
| 17 | |
| 18 | use pound::Parse; |
| 19 | |
| 20 | fn main() { |
| 21 | #[cfg(target_os = "linux")] |
| 22 | if let Some(code) = systemd::exec() { |
| 23 | std::process::exit(code); |
| 24 | } |
| 25 | // a typo must not exit 2, that's a blocking pretooluse verdict and would |
| 26 | // wall off every bash call in every session |
| 27 | let cfg = config::Config::load().unwrap_or_else(|e| { |
| 28 | eprintln!("rabt: bad config, using defaults. {e}"); |
| 29 | config::Config::default() |
| 30 | }); |
| 31 | std::process::exit(cli::dispatch(&cfg, cli::Rabt::parse())); |
| 32 | } |