From 5233cd679a4579d8d770315987915f2de0c0a09b Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Tue, 27 Jun 2023 18:53:26 +0200 Subject: [PATCH] early license printing --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e284641..219c201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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"); } } }