1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! File export command parser types.
//!
//! This module owns the clap contract for `tokmd export` while the parent parser
//! module keeps the top-level command dispatch shape.
use std::path::PathBuf;
use clap::Args;
use super::{ChildIncludeMode, ExportFormat, RedactMode};
#[derive(Args, Debug, Clone)]
pub struct CliExportArgs {
/// Paths to scan (directories, files, or globs). Defaults to "."
#[arg(value_name = "PATH")]
pub paths: Option<Vec<PathBuf>>,
/// Output format [default: jsonl].
#[arg(long, value_enum)]
pub format: Option<ExportFormat>,
/// Write output to this file instead of stdout.
#[arg(long, value_name = "PATH", visible_alias = "out")]
pub output: Option<PathBuf>,
/// Module roots (see `tokmd module`) [default: crates,packages].
#[arg(long, value_delimiter = ',')]
pub module_roots: Option<Vec<String>>,
/// Module depth (see `tokmd module`) [default: 2].
#[arg(long, visible_alias = "depth")]
pub module_depth: Option<usize>,
/// Whether to include embedded languages (tokei "children" / blobs) [default: separate].
#[arg(long, value_enum)]
pub children: Option<ChildIncludeMode>,
/// Drop rows with fewer than N code lines [default: 0].
#[arg(long)]
pub min_code: Option<usize>,
/// Stop after emitting N rows (0 = unlimited) [default: 0].
#[arg(long)]
pub max_rows: Option<usize>,
/// Include a meta record (JSON / JSONL only). Enabled by default.
#[arg(long, action = clap::ArgAction::Set)]
pub meta: Option<bool>,
/// Redact paths (and optionally module names) for safer copy/paste into LLMs [default: none].
#[arg(long, value_enum)]
pub redact: Option<RedactMode>,
/// Strip this prefix from paths before output (helps when paths are absolute).
#[arg(long, value_name = "PATH")]
pub strip_prefix: Option<PathBuf>,
}