Skip to main content

talon_cli/cli/
inspect_args.rs

1//! Arguments for `talon inspect`.
2
3use clap::{Args, ValueEnum};
4
5use crate::cli::SharedScopeArgs;
6
7/// Inspect check type (clap derive wrapper).
8#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
9pub enum InspectCheck {
10    /// Run all checks.
11    All,
12    /// Find orphan notes with no links to them.
13    Orphans,
14    /// Find broken wikilinks.
15    BrokenLinks,
16    /// Find dangling reference markers.
17    DanglingRefs,
18    /// Find unreferenced notes.
19    Unreferenced,
20    /// Find graph health signals and missing-link suggestions.
21    Graph,
22}
23
24impl From<InspectCheck> for talon_core::InspectCheck {
25    fn from(check: InspectCheck) -> Self {
26        match check {
27            InspectCheck::All => Self::All,
28            InspectCheck::Orphans => Self::Orphans,
29            InspectCheck::BrokenLinks => Self::BrokenLinks,
30            InspectCheck::DanglingRefs => Self::DanglingRefs,
31            InspectCheck::Unreferenced => Self::Unreferenced,
32            InspectCheck::Graph => Self::Graph,
33        }
34    }
35}
36
37/// Arguments for the `inspect` subcommand.
38#[derive(Debug, Clone, Args)]
39#[command(about = "Inspect your vault for structural signals and patterns.")]
40pub struct InspectArgs {
41    /// Which inspect check to run (default: all).
42    #[arg(value_enum, ignore_case = true)]
43    pub check: Option<InspectCheck>,
44
45    #[command(flatten)]
46    pub scope: SharedScopeArgs,
47
48    /// Maximum number of findings to display.
49    #[arg(long, short = 'n', global = true)]
50    pub limit: Option<u16>,
51}