From 7478aeb2d30f12e48568783f0dc7a0eeeb9e850e Mon Sep 17 00:00:00 2001 From: Michal S Date: Fri, 9 Sep 2022 00:18:23 +0100 Subject: [PATCH] Fix flipped detect bool and readded `diff` --- src/internal/detect.rs | 12 ++++++------ src/main.rs | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/internal/detect.rs b/src/internal/detect.rs index bbd81b1..1ae4b26 100644 --- a/src/internal/detect.rs +++ b/src/internal/detect.rs @@ -49,12 +49,6 @@ pub async fn detect() { if choice { let config = Config::get(); if config.base.pacdiff_warn { - ShellCommand::pacdiff() - .elevated() - .wait() - .await - .silent_unwrap(AppExitCode::PacmanError); - } else { tracing::warn!("Pacdiff uses vimdiff by default to edit files for merging. You can focus panes by mousing over them and pressing left click, and scroll up and down using your mouse's scroll wheel (or the arrow keys). To exit vimdiff, press the following key combination: ESC, :qa!, ENTER"); tracing::warn!("You can surpress this warning in the future by setting `pacdiff_warn` to \"false\" in ~/.config/ame/config.toml"); @@ -65,6 +59,12 @@ pub async fn detect() { .await .silent_unwrap(AppExitCode::PacmanError); } + } else { + ShellCommand::pacdiff() + .elevated() + .wait() + .await + .silent_unwrap(AppExitCode::PacmanError); } } } diff --git a/src/main.rs b/src/main.rs index a49217b..6f6d0bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use builder::pacman::{PacmanColor, PacmanQueryBuilder}; use clap::Parser; use internal::commands::ShellCommand; +use internal::detect; use internal::error::SilentUnwrap; use crate::args::{InstallArgs, Operation, QueryArgs, RemoveArgs}; @@ -68,7 +69,7 @@ async fn main() { operations::clean(options).await; } Operation::GenComp(gen_args) => cmd_gencomp(&gen_args), - Operation::Diff => todo!(), + Operation::Diff => detect().await, } }