diff --git a/.gitignore b/.gitignore index 0c72cc3..5230240 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ /samples *.log config.ini +/backups/ +/logs/ +NotAlterra_LICENSE_ACCEPTED .deepseek /builds/ diff --git a/src/config.rs b/src/config.rs index 15251e0..3730397 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,22 @@ pub fn accept_disclaimer() -> std::io::Result<()> { Ok(()) } +/// Path to the stale `config.ini` from v0.3.0 and earlier. +pub fn stale_config_path() -> PathBuf { + exe_dir().join("config.ini") +} + +/// Remove the stale `config.ini` if it exists. Returns `true` if removed. +pub fn cleanup_stale_config() -> bool { + let path = stale_config_path(); + if path.exists() { + std::fs::remove_file(&path).ok(); + true + } else { + false + } +} + /// Return the directory containing the running executable. pub fn exe_dir() -> PathBuf { std::env::current_exe() diff --git a/src/main.rs b/src/main.rs index 266d696..c092246 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,6 +39,15 @@ const VERSION: &str = concat!("v", env!("CARGO_PKG_VERSION")); /// Entry point — parses args, loads config, and starts the TUI loop. fn main() -> Result<()> { for arg in std::env::args().skip(1) { + if arg == "--help" || arg == "-h" { + println!("notalterra {}", VERSION); + println!("Subnautica 2 save-file manager — cross-platform terminal application."); + println!(); + println!("Usage: notalterra [--version | --help]"); + println!(); + println!("Run with no arguments to start the interactive terminal UI."); + return Ok(()); + } if arg == "--version" || arg == "-v" { println!("notalterra {}", VERSION); return Ok(()); @@ -148,6 +157,11 @@ fn run_app(terminal: &mut Terminal) -> Result<()> { result in incomplete, corrupt, or overwritten save files.", )?; + // Clean up stale config.ini from v0.3.0 and earlier + if crate::config::cleanup_stale_config() { + guard::log_action("MIGRATE", "old config.ini removed", "SAFE", &app.log_path)?; + } + // Quick check of common save locations (current user only, no profile scans) if app.save_folder.is_none() { if let Some(path) = discovery::quick_discover() {