14 lines
346 B
Rust
14 lines
346 B
Rust
use super::Exit;
|
|
|
|
/// A subcommand that keel can run.
|
|
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
|
|
/// internal error never aborts a pacman transaction.
|
|
fn on_error(&self) -> Exit { Exit::Error }
|
|
}
|