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
use clap::{Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(name = "shotext")]
#[command(about = "OCR and Index your Mac screenshots", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
/// Custom config file path
#[arg(short, long, value_name = "FILE")]
pub config: Option<PathBuf>,
}
#[derive(Subcommand)]
pub enum Commands {
/// Ingest all screenshots from the configured folder
Ingest {
/// Force re-indexing of already processed files
#[arg(short, long)]
force: bool,
},
/// Start a background watcher for new screenshots
Watch,
/// List all indexed screenshots
List {
/// Show date and text snippet alongside the path
#[arg(short, long)]
verbose: bool,
},
/// Search through indexed screenshots using fuzzy find
Search {
/// The search query for Tantivy
query: Option<String>,
},
/// View the screenshot along with the extracted text
View {
/// The hash or path of the screenshot to open in the GUI
target: String,
},
/// Initialise or show current configuration
Config {
#[arg(short, long)]
edit: bool,
},
}