diff --git a/client/src/archive.rs b/client/src/archive.rs index a35780a..f365b91 100644 --- a/client/src/archive.rs +++ b/client/src/archive.rs @@ -64,7 +64,7 @@ impl Archive { } } - /// Adds a path and it's contents to the list of tracked game files + /// Adds a path and its contents to the list of tracked game files /// /// TODO: Add note here about how GameSaveLocation, GameFile and tracking individual files rather than directories work /// @@ -75,10 +75,10 @@ impl Archive { /// ``` /// # use client::archive::Archive; /// let mut archive = Archive::try_default().unwrap(); - /// let game_save_path = "/home/user/Documents/generic_company/generic_game/save_folder"; - /// match archive.track_game(game_save_path) { - /// Ok(_) => println!("Save Sync is now tracking {}", game_save_path), - /// Err(err) => eprintln!("Failed to track {}: {:?}", game_save_path, err) + /// let save_path = "/home/user/Documents/generic_company/generic_game/save_folder"; + /// match archive.track_game(save_path) { + /// Ok(_) => println!("Save Sync is now tracking {}", save_path), + /// Err(err) => eprintln!("Failed to track {}: {:?}", save_path, err) /// }; /// ``` pub fn track_game>(&mut self, path: P) -> Result<(), GameTrackError> { @@ -87,6 +87,23 @@ impl Archive { Ok(()) } + /// Adds a path and its contents to the list of tracked game files + /// + /// TODO: Add similar note to the one in [`track_game`] + /// + /// # Arguments + /// * `path` - The path which will be tracked along with any children it may have + /// + /// # Examples + /// ``` + /// # use client::archive::Archive; + /// let mut archive = Archive::try_default().unwrap(); + /// let save_path = "/home/user/Documents/generic_company/generic_game/save_folder"; + /// let friendly_name = "Generic Game"; + /// match archive.track_game_with_friendly(save_path, friendly_name) { + /// Ok(_) => println!("Save Sync is now tracking {}", friendly_name), + /// Err(err) => eprintln!("Save Sync failed to start tracking {}", friendly_name) + /// }; pub fn track_game_with_friendly

(&mut self, path: P, name: &str) -> Result<(), GameTrackError> where P: AsRef,