]>
git.proxmox.com Git - proxmox-offline-mirror.git/blob - src/bin/docgen.rs
1 use anyhow
::{bail, Error}
;
2 use proxmox_offline_mirror
::config
;
4 use proxmox_section_config
::dump_section_config
;
6 fn get_args() -> (String
, Vec
<String
>) {
7 let mut args
= std
::env
::args();
8 let prefix
= args
.next().unwrap();
9 let prefix
= prefix
.rsplit('
/'
).next().unwrap().to_string(); // without path
10 let args
: Vec
<String
> = args
.collect();
15 fn main() -> Result
<(), Error
> {
16 let (_prefix
, args
) = get_args();
19 bail
!("missing arguments");
22 for arg
in args
.iter() {
23 let text
= match arg
.as_ref() {
24 "mirror.cfg" => dump_section_config(&config
::CONFIG
),
25 _
=> bail
!("docgen: got unknown type"),