0
0
mirror of https://github.com/TeFiLeDo/listload.git synced 2024-11-01 01:56:17 +01:00

early license printing

This commit is contained in:
Adrian Wannenmacher 2023-06-27 18:53:26 +02:00
parent 5b9cc2f99d
commit 5233cd679a
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5

View File

@ -27,7 +27,12 @@ fn main() -> anyhow::Result<()> {
.ok()
.context("failed to initialize program directories")?;
// initialize downloading
if let CMD::License = cli.command {
println!("{}", include_str!("../LICENSE"));
return Ok(());
}
// prepare for operation
let cfg = Config::read_from_default_file().context("failed to load config")?;
let downloader = cfg.downloader().context("failed to create downloader")?;
@ -37,8 +42,7 @@ fn main() -> anyhow::Result<()> {
Ok(())
}
CMD::License => {
println!("{}", include_str!("../LICENSE"));
Ok(())
panic!("license passed first check");
}
}
}