42 lines
802 B
Rust
42 lines
802 B
Rust
use clap::{ Args, Subcommand };
|
|
|
|
use crate::cli::{ Exit, Command };
|
|
|
|
/// Manage the ELF symbol index.
|
|
#[derive(Debug, Args)]
|
|
pub struct Cache {
|
|
#[command(subcommand)]
|
|
pub action: CacheAction,
|
|
}
|
|
|
|
#[derive(Debug, Subcommand)]
|
|
pub enum CacheAction {
|
|
Prune(Prune),
|
|
}
|
|
|
|
impl CacheAction
|
|
{
|
|
pub fn command(&self) -> &dyn Command
|
|
{
|
|
match self {
|
|
Self::Prune(c) => c,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Command for Cache
|
|
{
|
|
fn run(&self) -> anyhow::Result<Exit> { self.action.command().run() }
|
|
|
|
fn on_error(&self) -> Exit { self.action.command().on_error() }
|
|
}
|
|
|
|
/// Drop index entries for package versions that are no longer installed.
|
|
#[derive(Debug, Args)]
|
|
pub struct Prune;
|
|
|
|
impl Command for Prune
|
|
{
|
|
fn run(&self) -> anyhow::Result<Exit> { todo!("keel cache prune") }
|
|
}
|