From 06cfbc792be7e9129d04307015c64f8b7d597c07 Mon Sep 17 00:00:00 2001 From: steven-omaha <35634100+steven-omaha@users.noreply.github.com> Date: Mon, 15 May 2023 13:24:30 +0200 Subject: [PATCH] refact(main): major update message --- crates/main/main.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/crates/main/main.rs b/crates/main/main.rs index 0cce355..0d45fef 100644 --- a/crates/main/main.rs +++ b/crates/main/main.rs @@ -23,6 +23,13 @@ use anyhow::{Context, Result}; use pacdef_core::path::{get_config_path, get_config_path_old_version, get_group_dir}; use pacdef_core::{get_args, Config, Group, Pacdef}; +const MAJOR_UPDATE_MESSAGE: &str = "VERSION UPGRADE +You seem to have used version 0.x of pacdef before. +Version 1.x changes the syntax of the config files and the command line arguments. +Check out https://github.com/steven-omaha/pacdef for new syntax information. +This message will not appear again. +------"; + fn main() -> ExitCode { handle_final_result(main_inner()) } @@ -63,7 +70,7 @@ fn main_inner() -> Result<()> { fn load_default_config(config_file: &Path) -> Result { if get_config_path_old_version()?.exists() { - show_transition_link(); + println!("{MAJOR_UPDATE_MESSAGE}"); } let default = Config::default(); @@ -71,12 +78,3 @@ fn load_default_config(config_file: &Path) -> Result { Ok(default) } - -fn show_transition_link() { - println!("VERSION UPGRADE"); - println!("You seem to have used version 0.x of pacdef before."); - println!("Version 1.x changes the syntax of the config files and the command line arguments."); - println!("Check out https://github.com/steven-omaha/pacdef for new syntax information."); - println!("This message will not appear again."); - println!("------"); -}