diff --git a/src/archive.rs b/src/archive.rs index 08a89dd..f8909e2 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -25,6 +25,7 @@ use tar::Archive; use xz2::read::XzDecoder; use xz2::write::XzEncoder; +/// Exports an inventory slot into an xz tarball pub fn export_inv(slot: &str, output: PathBuf, message: bool) -> Result<()> { let slotdir: PathBuf = match slot { "active" | "a" => common::env_config()?.active_dir, @@ -54,6 +55,7 @@ pub fn export_inv(slot: &str, output: PathBuf, message: bool) -> Result<()> { Ok(()) } +/// Exports the Vento directory into an xz tarball pub fn export_dir(output: PathBuf, message: bool) -> Result<()> { let dir: PathBuf = common::env_config()?.vento_dir; @@ -72,6 +74,7 @@ pub fn export_dir(output: PathBuf, message: bool) -> Result<()> { Ok(()) } +/// Imports an xz tarball into an inventory slot pub fn import_inv(input: PathBuf, slot: &str, message: bool) -> Result<()> { let slotdir: PathBuf = match slot { "active" | "a" => common::env_config()?.active_dir, @@ -102,6 +105,7 @@ pub fn import_inv(input: PathBuf, slot: &str, message: bool) -> Result<()> { Ok(()) } +/// Imports an xz tarball into the Vento directory pub fn import_dir(input: PathBuf, message: bool) -> Result<()> { let dir: PathBuf = common::env_config()?.vento_dir; diff --git a/src/error.rs b/src/error.rs index bc8fde3..1a6593f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -35,6 +35,7 @@ pub enum ErrorType { NoFileOrDir, } +/// Displays an error and exits pub fn throw_error(error: ErrorType) -> Result<()> { bail!( "{}",