Fix formatting issues.

This commit is contained in:
Overlord committed 2026-10-17 01:38:34 +02:00
1 parent 70dec5834e
commit d6999153ae
15 files changed
+30 -28

No files matched your search

+2 -2
View File
@@ -1,13 +1,13 @@
use super::Exit;
/// A subcommand that keel can run.
pub trait Command
pub trait Command
{
fn run(&self) -> anyhow::Result<Exit>;
/// The exit status used when `run` returns an error.
///
/// Hook subcommands return `Exit::Ok` here, so an
/// Hook subcommands return `Exit::Ok` here, so an
/// internal error never aborts a pacman transaction.
fn on_error(&self) -> Exit { Exit::Error }
}
+2 -1
View File
@@ -6,6 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Ack;
impl Command for Ack {
impl Command for Ack
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel ack") }
}
+4 -4
View File
@@ -14,9 +14,9 @@ pub enum CacheAction {
Prune(Prune),
}
impl CacheAction
impl CacheAction
{
pub fn command(&self) -> &dyn Command
pub fn command(&self) -> &dyn Command
{
match self {
Self::Prune(c) => c,
@@ -24,7 +24,7 @@ impl CacheAction
}
}
impl Command for Cache
impl Command for Cache
{
fn run(&self) -> anyhow::Result<Exit> { self.action.command().run() }
@@ -35,7 +35,7 @@ impl Command for Cache
#[derive(Debug, Args)]
pub struct Prune;
impl Command for Prune
impl Command for Prune
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel cache prune") }
}
+1 -1
View File
@@ -10,7 +10,7 @@ pub struct Check {
pub download: bool,
}
impl Command for Check
impl Command for Check
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel check") }
}
+2 -2
View File
@@ -5,13 +5,13 @@ use crate::cli::{ Exit, Command };
/// Show the package changes between a snapshot and the live root.
#[derive(Debug, Args)]
pub struct Diff {
/// The snapshot to compare with, as the snapshot provider names it.
/// The snapshot to compare with, as the snapshot provider names it.
/// The default is the rollback target.
#[arg(value_name = "SNAPSHOT")]
pub snapshot: Option<String>,
}
impl Command for Diff
impl Command for Diff
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel diff") }
}
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Doctor;
impl Command for Doctor
impl Command for Doctor
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel doctor") }
}
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Gc;
impl Command for Gc
impl Command for Gc
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel gc") }
}
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Index;
impl Command for Index
impl Command for Index
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel index") }
}
+3 -3
View File
@@ -13,15 +13,15 @@ mod toggle;
mod verify;
pub use ack::Ack;
pub use cache::{Cache, CacheAction, Prune};
pub use cache::{ Cache, Prune, CacheAction };
pub use check::Check;
pub use diff::Diff;
pub use doctor::Doctor;
pub use gc::Gc;
pub use hook::{Hook, Phase, Post, Pre, Removals};
pub use hook::{ Pre, Hook, Post, Phase, Removals };
pub use index::Index;
pub use notify::Notify;
pub use rollback::Rollback;
pub use status::Status;
pub use toggle::{Disable, Enable, HookSet};
pub use toggle::{ Enable, Disable, HookSet };
pub use verify::Verify;
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Notify;
impl Command for Notify
impl Command for Notify
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel notify") }
}
+5 -5
View File
@@ -5,8 +5,8 @@ use crate::cli::{ Exit, Command };
/// Replace the root subvolume with a writable copy of a snapshot.
#[derive(Debug, Args)]
pub struct Rollback {
/// The snapshot to restore, as the snapshot provider names it. The default is the rollback
/// target.
/// The snapshot to restore, as the snapshot provider names it.
/// The default is the rollback target.
#[arg(value_name = "SNAPSHOT", conflicts_with = "promote")]
pub snapshot: Option<String>,
@@ -22,13 +22,13 @@ pub struct Rollback {
#[arg(long)]
pub reboot: bool,
/// Wait until pacman releases its database lock, then roll back without asking. The post
/// hook starts this in a transient unit after the user has already confirmed.
/// Wait until pacman releases its database lock, then roll back without asking.
/// The post hook starts this in a transient unit after the user has already confirmed.
#[arg(long, hide = true, requires = "snapshot")]
pub deferred: bool,
}
impl Command for Rollback
impl Command for Rollback
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel rollback") }
}
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::cli::{ Exit, Command };
#[derive(Debug, Args)]
pub struct Status;
impl Command for Status
impl Command for Status
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel status") }
}
+2 -2
View File
@@ -18,7 +18,7 @@ pub struct Enable {
pub hooks: HookSet,
}
impl Command for Enable
impl Command for Enable
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel enable") }
}
@@ -29,7 +29,7 @@ pub struct Disable {
pub hooks: HookSet,
}
impl Command for Disable
impl Command for Disable
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel disable") }
}
+3 -3
View File
@@ -4,15 +4,15 @@ use std::process::ExitCode;
#[repr(u8)]
pub enum Exit {
Ok = 0,
/// Blocking findings, or a refused rollback.
/// The pre hook's wrapper aborts pacman on
/// Blocking findings, or a refused rollback.
/// The pre hook's wrapper aborts pacman on
/// this status and on no other.
Blocked = 1,
/// A usage or environment error.
Error = 2,
}
impl From<Exit> for ExitCode
impl From<Exit> for ExitCode
{
fn from(exit: Exit) -> Self { ExitCode::from(exit as u8) }
}