diff --git a/src/backend/actual/pacman.rs b/src/backend/actual/pacman.rs index 4bcb465..03bb40d 100644 --- a/src/backend/actual/pacman.rs +++ b/src/backend/actual/pacman.rs @@ -18,10 +18,10 @@ pub(crate) struct Pacman { const BINARY: Text = "paru"; const SECTION: Text = "pacman"; -const SWITCHES_INFO: Switches = &["-Qi"]; -const SWITCHES_INSTALL: Switches = &["-S"]; -const SWITCHES_MAKE_DEPENDENCY: Switches = &["-D", "--asdeps"]; -const SWITCHES_REMOVE: Switches = &["-Rsn"]; +const SWITCHES_INFO: Switches = &["--query", "--info"]; +const SWITCHES_INSTALL: Switches = &["--sync"]; +const SWITCHES_MAKE_DEPENDENCY: Switches = &["--database", "--asdeps"]; +const SWITCHES_REMOVE: Switches = &["--remove", "--recursive"]; impl Backend for Pacman { impl_backend_constants!(); diff --git a/src/backend/todo_per_backend.rs b/src/backend/todo_per_backend.rs index 02bb114..46dcc28 100644 --- a/src/backend/todo_per_backend.rs +++ b/src/backend/todo_per_backend.rs @@ -31,10 +31,12 @@ impl ToDoPerBackend { pub(crate) fn install_missing_packages(&self) -> Result<()> { self.handle_backend_command(Backend::install_packages, "install", "installing") + .context("installing packages") } pub(crate) fn remove_unmanaged_packages(&self) -> Result<()> { self.handle_backend_command(Backend::remove_packages, "remove", "removing") + .context("removing packages") } fn handle_backend_command<'a, F>( diff --git a/src/core.rs b/src/core.rs index 83c2b32..e68c117 100644 --- a/src/core.rs +++ b/src/core.rs @@ -3,7 +3,7 @@ use std::fs::{remove_file, File}; use std::os::unix::fs::symlink; use std::path::PathBuf; -use anyhow::{ensure, Context, Result}; +use anyhow::{anyhow, ensure, Context, Result}; use clap::ArgMatches; use crate::action::*; @@ -189,7 +189,11 @@ impl Pacdef { let mut iter = groups.get_many::("group").unwrap().peekable(); while let Some(arg_group) = iter.next() { - let group = self.groups.iter().find(|g| g.name == *arg_group).unwrap(); + let group = self + .groups + .iter() + .find(|g| g.name == *arg_group) + .ok_or_else(|| anyhow!("group {} not found", *arg_group))?; println!("{group}"); if iter.peek().is_some() { println!();