Add core CLI command structure and subcommands.

This commit is contained in:
Overlord committed 2026-10-16 22:24:35 +02:00
1 parent 5c262fe425
commit 70dec5834e
19 files changed
+447 -1

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
use clap::Args;
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.
#[arg(value_name = "SNAPSHOT", conflicts_with = "promote")]
pub snapshot: Option<String>,
/// Restore the snapshot the system is currently booted from.
#[arg(long)]
pub promote: bool,
/// Skip the confirmation prompt.
#[arg(long, short = 'y')]
pub yes: bool,
/// Reboot without asking once the rollback is done.
#[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.
#[arg(long, hide = true, requires = "snapshot")]
pub deferred: bool,
}
impl Command for Rollback
{
fn run(&self) -> anyhow::Result<Exit> { todo!("keel rollback") }
}