Skip to main content

tuwunel_admin/integrity/
mod.rs

1mod check;
2mod list;
3mod repair;
4
5use clap::Subcommand;
6use tuwunel_core::Result;
7
8use crate::admin_command_dispatch;
9
10const DEFAULT_LIMIT: usize = 8;
11
12#[admin_command_dispatch(handler_prefix = "integrity")]
13#[derive(Debug, Subcommand)]
14pub(crate) enum IntegrityCommand {
15	/// - List the database integrity checks
16	List,
17
18	/// - Run database integrity checks, changing nothing
19	Check {
20		/// The checks to run; every check that can run here when none is named.
21		names: Vec<String>,
22
23		/// The number of findings to show from each check.
24		#[arg(long, default_value_t = DEFAULT_LIMIT)]
25		limit: usize,
26	},
27
28	/// - Schedule a check's repair for the next start by clearing its stamp
29	///
30	/// Requires the `--yes-i-know-what-im-doing` flag.
31	Repair {
32		/// The check whose repair to schedule.
33		name: String,
34
35		/// Confirms clearing the stamp.
36		#[arg(long)]
37		yes_i_know_what_im_doing: bool,
38	},
39}