diff --git a/src/main.rs b/src/main.rs index 7223584d5009fde938b4c06833e4aa4361fd5d2c..10439a593045d262bcfaa9a22562d2d4e66ff835 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,7 +52,8 @@ enum Commands { DeleteHooks, /// Show differences between two commits of the `results` folder Diff(Diff), - /// Mount an old file/directory from one or multiple commits into the .mount folder inside de project directory. + /// Mount an old file/directory from one or multiple archive named afert + /// git commits into the .mount folder inside de project directory. Mount(Mount), /// Unmount everything in the folder .mount Umount, @@ -143,20 +144,36 @@ struct Diff { #[derive(Debug, Args)] struct Mount { - /// Commit name, sh: Glob is supported. - /// This is an optional parameter: if not set then all commits will be displayed + /// Commit name, sh: Glob is supported. This is an optional parameter: if + /// not set then all commit archives will be mounted into the .mount directory #[clap(short, long)] commit: Option<String>, - /// The file/directory to extract - /// This is an optional parameter. If not set then all files in the archive will be displayed + /// The file/directory to extract. This is an optional parameter. If not set + /// then all files in the archive will be displayed #[clap(short, long)] path: Option<String>, /// If set, displays the .mount directory in 'version view'. /// - /// - Normal view: The mount directory contains a subfolder with the name of archives - /// - Version view: The mount directory contains the results folder and every file within it becomes a directory storing every version of that file + /// - Normal view: The `.mount` directory contains a subfolder with the name + /// of archives. + /// + /// - Version view: The `.mount` directory contains the results folder and + /// every file within it becomes a directory storing every version of + /// that file #[clap(short, long)] versions: bool, + /// Displays the differences between two files mounted corresponding to the + /// given path. + /// + /// Note that if only one file is recovered then, the other is taken from + /// the current result folder + /// + /// This option is deactivated when used with --diff + #[clap(short, long)] + diff: bool, + /// Consider last N archive after other filter were applied + #[clap(short, long)] + last: Option<u8>, } fn main() { @@ -201,7 +218,13 @@ fn main() { } Commands::Mount(mount) => { mount::umount_archive(true); - mount::mount_archive(&mount.commit, &mount.path, mount.versions); + mount::mount_archive( + &mount.commit, + &mount.path, + mount.versions, + mount.diff, + mount.last, + ); } Commands::Umount => { mount::umount_archive(false);